From f7e80423af34908bd854fa01bd7c7fe691554df8 Mon Sep 17 00:00:00 2001 From: Sven Neumann Date: Tue, 31 Aug 1999 09:19:13 +0000 Subject: [PATCH] sanity check in popup_open() --Sven --- ChangeLog | 5 +++++ app/gimpbrushpreview.c | 6 +++++- app/gimppatternpreview.c | 6 +++++- app/widgets/gimpbrushpreview.c | 6 +++++- app/widgets/gimppatternpreview.c | 6 +++++- app/widgets/gimppreviewrendererbrush.c | 6 +++++- app/widgets/gimpviewrendererbrush.c | 6 +++++- 7 files changed, 35 insertions(+), 6 deletions(-) diff --git a/ChangeLog b/ChangeLog index 408140f889..69a48f32f9 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +Tue Aug 31 11:16:52 MEST 1999 Sven Neumann + + * app/gimpbrushpreview.c + * app/gimppatternpreview.c: check if brush/pattern is not NULL + Tue Aug 31 01:13:13 EDT 1999 Adrian Likins * app/pencil.c: add a "Use Pressure" check button to the options diff --git a/app/gimpbrushpreview.c b/app/gimpbrushpreview.c index 44423f9999..ae47ad5a2f 100644 --- a/app/gimpbrushpreview.c +++ b/app/gimpbrushpreview.c @@ -231,6 +231,10 @@ gimp_brush_preview_popup_open (GimpBrushPreview *gbp, gint width, height; guchar bg; + g_return_if_fail (gbp != NULL); + if (!gbp->brush) + return; + width = gbp->brush->mask->width; height = gbp->brush->mask->height; @@ -334,7 +338,7 @@ gimp_brush_preview_draw (GimpBrushPreview *gbp) guchar bg; gint x, y; - g_return_if_fail (gbp->brush != NULL); + g_return_if_fail (gbp != NULL && gbp->brush != NULL); brush_width = gbp->brush->mask->width; brush_height = gbp->brush->mask->height; diff --git a/app/gimppatternpreview.c b/app/gimppatternpreview.c index efc920f372..9e86c129e8 100644 --- a/app/gimppatternpreview.c +++ b/app/gimppatternpreview.c @@ -205,6 +205,10 @@ gimp_pattern_preview_popup_open (GimpPatternPreview *gpp, guchar *mask; gint width, height; + g_return_if_fail (gpp != NULL); + if (!gpp->pattern) + return; + width = gpp->pattern->mask->width; height = gpp->pattern->mask->height; @@ -296,7 +300,7 @@ gimp_pattern_preview_draw (GimpPatternPreview *gpp) guchar *mask, *buf, *b; gint x, y; - g_return_if_fail (gpp->pattern != NULL); + g_return_if_fail (gpp != NULL && gpp->pattern != NULL); pattern_width = gpp->pattern->mask->width; pattern_height = gpp->pattern->mask->height; diff --git a/app/widgets/gimpbrushpreview.c b/app/widgets/gimpbrushpreview.c index 44423f9999..ae47ad5a2f 100644 --- a/app/widgets/gimpbrushpreview.c +++ b/app/widgets/gimpbrushpreview.c @@ -231,6 +231,10 @@ gimp_brush_preview_popup_open (GimpBrushPreview *gbp, gint width, height; guchar bg; + g_return_if_fail (gbp != NULL); + if (!gbp->brush) + return; + width = gbp->brush->mask->width; height = gbp->brush->mask->height; @@ -334,7 +338,7 @@ gimp_brush_preview_draw (GimpBrushPreview *gbp) guchar bg; gint x, y; - g_return_if_fail (gbp->brush != NULL); + g_return_if_fail (gbp != NULL && gbp->brush != NULL); brush_width = gbp->brush->mask->width; brush_height = gbp->brush->mask->height; diff --git a/app/widgets/gimppatternpreview.c b/app/widgets/gimppatternpreview.c index efc920f372..9e86c129e8 100644 --- a/app/widgets/gimppatternpreview.c +++ b/app/widgets/gimppatternpreview.c @@ -205,6 +205,10 @@ gimp_pattern_preview_popup_open (GimpPatternPreview *gpp, guchar *mask; gint width, height; + g_return_if_fail (gpp != NULL); + if (!gpp->pattern) + return; + width = gpp->pattern->mask->width; height = gpp->pattern->mask->height; @@ -296,7 +300,7 @@ gimp_pattern_preview_draw (GimpPatternPreview *gpp) guchar *mask, *buf, *b; gint x, y; - g_return_if_fail (gpp->pattern != NULL); + g_return_if_fail (gpp != NULL && gpp->pattern != NULL); pattern_width = gpp->pattern->mask->width; pattern_height = gpp->pattern->mask->height; diff --git a/app/widgets/gimppreviewrendererbrush.c b/app/widgets/gimppreviewrendererbrush.c index 44423f9999..ae47ad5a2f 100644 --- a/app/widgets/gimppreviewrendererbrush.c +++ b/app/widgets/gimppreviewrendererbrush.c @@ -231,6 +231,10 @@ gimp_brush_preview_popup_open (GimpBrushPreview *gbp, gint width, height; guchar bg; + g_return_if_fail (gbp != NULL); + if (!gbp->brush) + return; + width = gbp->brush->mask->width; height = gbp->brush->mask->height; @@ -334,7 +338,7 @@ gimp_brush_preview_draw (GimpBrushPreview *gbp) guchar bg; gint x, y; - g_return_if_fail (gbp->brush != NULL); + g_return_if_fail (gbp != NULL && gbp->brush != NULL); brush_width = gbp->brush->mask->width; brush_height = gbp->brush->mask->height; diff --git a/app/widgets/gimpviewrendererbrush.c b/app/widgets/gimpviewrendererbrush.c index 44423f9999..ae47ad5a2f 100644 --- a/app/widgets/gimpviewrendererbrush.c +++ b/app/widgets/gimpviewrendererbrush.c @@ -231,6 +231,10 @@ gimp_brush_preview_popup_open (GimpBrushPreview *gbp, gint width, height; guchar bg; + g_return_if_fail (gbp != NULL); + if (!gbp->brush) + return; + width = gbp->brush->mask->width; height = gbp->brush->mask->height; @@ -334,7 +338,7 @@ gimp_brush_preview_draw (GimpBrushPreview *gbp) guchar bg; gint x, y; - g_return_if_fail (gbp->brush != NULL); + g_return_if_fail (gbp != NULL && gbp->brush != NULL); brush_width = gbp->brush->mask->width; brush_height = gbp->brush->mask->height;