From 48f4745b8da696d32639dfed67da35787d80e28b Mon Sep 17 00:00:00 2001 From: pabs Date: Sun, 27 Aug 2000 01:54:14 +0000 Subject: [PATCH] evas_get_color() attempts to dereference and write to every color channel ptr without checking to see if it's null. -- ie things like evas_get_color(evas, obj, &r, &g, &b, 0) will actually work now. raster is a naugty boy. no pudding for raster tonight. SVN revision: 3266 --- legacy/evas/src/evas_misc.c | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/legacy/evas/src/evas_misc.c b/legacy/evas/src/evas_misc.c index 98acd03062..961649af53 100644 --- a/legacy/evas/src/evas_misc.c +++ b/legacy/evas/src/evas_misc.c @@ -97,10 +97,10 @@ evas_get_color(Evas e, Evas_Object o, int *r, int *g, int *b, int *a) Evas_Object_Text oo; oo = (Evas_Object_Text)o; - *r = oo->current.r; - *g = oo->current.g; - *b = oo->current.b; - *a = oo->current.a; + if (r) *r = oo->current.r; + if (g) *g = oo->current.g; + if (b) *b = oo->current.b; + if (a) *a = oo->current.a; } break; case OBJECT_RECTANGLE: @@ -108,10 +108,10 @@ evas_get_color(Evas e, Evas_Object o, int *r, int *g, int *b, int *a) Evas_Object_Rectangle oo; oo = (Evas_Object_Rectangle)o; - *r = oo->current.r; - *g = oo->current.g; - *b = oo->current.b; - *a = oo->current.a; + if (r) *r = oo->current.r; + if (g) *g = oo->current.g; + if (b) *b = oo->current.b; + if (a) *a = oo->current.a; } break; case OBJECT_LINE: @@ -119,10 +119,10 @@ evas_get_color(Evas e, Evas_Object o, int *r, int *g, int *b, int *a) Evas_Object_Line oo; oo = (Evas_Object_Line)o; - *r = oo->current.r; - *g = oo->current.g; - *b = oo->current.b; - *a = oo->current.a; + if (r) *r = oo->current.r; + if (g) *g = oo->current.g; + if (b) *b = oo->current.b; + if (a) *a = oo->current.a; } break; default: