summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJihoon Kim <jihoon48.kim@samsung.com>2013-12-31 11:36:43 +0900
committerDaniel Juyung Seo <juyung.seo@samsung.com>2013-12-31 13:23:39 +0900
commit8ac47e37a5415705d15f7bb85ae9d8c80fb9c795 (patch)
tree67382eb43d57147bf774cec1b8c7d260c8cee3e0
parente33aa23cb8b31095d78fe1fc508ef7f4f8cfc677 (diff)
image: add NULL check
-rw-r--r--src/lib/elm_image.c34
1 files changed, 18 insertions, 16 deletions
diff --git a/src/lib/elm_image.c b/src/lib/elm_image.c
index e5657bf33..c961d4aab 100644
--- a/src/lib/elm_image.c
+++ b/src/lib/elm_image.c
@@ -254,6 +254,8 @@ _elm_image_smart_smooth_scale_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
254 Eina_Bool *ret = va_arg(*list, Eina_Bool *); 254 Eina_Bool *ret = va_arg(*list, Eina_Bool *);
255 Elm_Image_Smart_Data *sd = _pd; 255 Elm_Image_Smart_Data *sd = _pd;
256 256
257 if (!ret) return;
258
257 if (sd->edje) 259 if (sd->edje)
258 { 260 {
259 *ret = EINA_FALSE; 261 *ret = EINA_FALSE;
@@ -286,7 +288,7 @@ _elm_image_smart_fill_inside_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
286 288
287 Elm_Image_Smart_Data *sd = _pd; 289 Elm_Image_Smart_Data *sd = _pd;
288 290
289 *ret = sd->fill_inside; 291 if (ret) *ret = sd->fill_inside;
290} 292}
291 293
292static void 294static void
@@ -313,7 +315,7 @@ _elm_image_smart_resize_up_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
313 315
314 Elm_Image_Smart_Data *sd = _pd; 316 Elm_Image_Smart_Data *sd = _pd;
315 317
316 *ret = sd->resize_up; 318 if (ret) *ret = sd->resize_up;
317} 319}
318 320
319static void 321static void
@@ -338,7 +340,7 @@ _elm_image_smart_resize_down_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
338 Eina_Bool *ret = va_arg(*list, Eina_Bool *); 340 Eina_Bool *ret = va_arg(*list, Eina_Bool *);
339 341
340 Elm_Image_Smart_Data *sd = _pd; 342 Elm_Image_Smart_Data *sd = _pd;
341 *ret = sd->resize_up; 343 if (ret) *ret = sd->resize_up;
342} 344}
343 345
344static void 346static void
@@ -803,7 +805,7 @@ _elm_image_smart_scale_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
803 Elm_Image_Smart_Data *sd = _pd; 805 Elm_Image_Smart_Data *sd = _pd;
804 double *ret = va_arg(*list, double *); 806 double *ret = va_arg(*list, double *);
805 807
806 *ret = sd->scale; 808 if (ret) *ret = sd->scale;
807} 809}
808 810
809EAPI Evas_Object * 811EAPI Evas_Object *
@@ -1088,7 +1090,7 @@ _elm_image_smart_smooth_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
1088{ 1090{
1089 Eina_Bool *ret = va_arg(*list, Eina_Bool *); 1091 Eina_Bool *ret = va_arg(*list, Eina_Bool *);
1090 Elm_Image_Smart_Data *sd = _pd; 1092 Elm_Image_Smart_Data *sd = _pd;
1091 *ret = sd->smooth; 1093 if (ret) *ret = sd->smooth;
1092} 1094}
1093 1095
1094EAPI void 1096EAPI void
@@ -1166,7 +1168,7 @@ _elm_image_smart_no_scale_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
1166{ 1168{
1167 Eina_Bool *ret = va_arg(*list, Eina_Bool *); 1169 Eina_Bool *ret = va_arg(*list, Eina_Bool *);
1168 Elm_Image_Smart_Data *sd = _pd; 1170 Elm_Image_Smart_Data *sd = _pd;
1169 *ret = sd->no_scale; 1171 if (ret) *ret = sd->no_scale;
1170} 1172}
1171 1173
1172EAPI void 1174EAPI void
@@ -1245,7 +1247,7 @@ _elm_image_smart_fill_outside_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
1245 Eina_Bool *ret = va_arg(*list, Eina_Bool *); 1247 Eina_Bool *ret = va_arg(*list, Eina_Bool *);
1246 1248
1247 Elm_Image_Smart_Data *sd = _pd; 1249 Elm_Image_Smart_Data *sd = _pd;
1248 *ret = !sd->fill_inside; 1250 if (ret) *ret = !sd->fill_inside;
1249} 1251}
1250 1252
1251EAPI void 1253EAPI void
@@ -1312,7 +1314,7 @@ _elm_image_smart_load_size_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
1312 1314
1313 int *ret = va_arg(*list, int *); 1315 int *ret = va_arg(*list, int *);
1314 1316
1315 *ret = sd->load_size; 1317 if (ret) *ret = sd->load_size;
1316} 1318}
1317 1319
1318EAPI void 1320EAPI void
@@ -1452,7 +1454,7 @@ _elm_image_smart_orient_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
1452 1454
1453 Elm_Image_Orient *ret = va_arg(*list, Elm_Image_Orient *); 1455 Elm_Image_Orient *ret = va_arg(*list, Elm_Image_Orient *);
1454 1456
1455 *ret = sd->orient; 1457 if (ret) *ret = sd->orient;
1456} 1458}
1457 1459
1458EAPI void 1460EAPI void
@@ -1517,7 +1519,7 @@ _elm_image_smart_editable_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
1517 Elm_Image_Smart_Data *sd = _pd; 1519 Elm_Image_Smart_Data *sd = _pd;
1518 Eina_Bool *ret = va_arg(*list, Eina_Bool *); 1520 Eina_Bool *ret = va_arg(*list, Eina_Bool *);
1519 1521
1520 *ret = sd->edit; 1522 if (ret) *ret = sd->edit;
1521} 1523}
1522 1524
1523EAPI Evas_Object * 1525EAPI Evas_Object *
@@ -1537,7 +1539,7 @@ _elm_image_smart_object_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
1537 1539
1538 Elm_Image_Smart_Data *sd = _pd; 1540 Elm_Image_Smart_Data *sd = _pd;
1539 1541
1540 *ret = sd->img; 1542 if (ret) *ret = sd->img;
1541} 1543}
1542 1544
1543EAPI void 1545EAPI void
@@ -1577,7 +1579,7 @@ _elm_image_smart_aspect_fixed_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
1577 Elm_Image_Smart_Data *sd = _pd; 1579 Elm_Image_Smart_Data *sd = _pd;
1578 Eina_Bool *ret = va_arg(*list, Eina_Bool *); 1580 Eina_Bool *ret = va_arg(*list, Eina_Bool *);
1579 1581
1580 *ret = sd->aspect_fixed; 1582 if (ret) *ret = sd->aspect_fixed;
1581} 1583}
1582 1584
1583EAPI Eina_Bool 1585EAPI Eina_Bool
@@ -1598,11 +1600,11 @@ _elm_image_smart_animated_available_get(Eo *obj, void *_pd, va_list *list)
1598 1600
1599 if (sd->edje) 1601 if (sd->edje)
1600 { 1602 {
1601 *ret = EINA_FALSE; 1603 if (ret) *ret = EINA_FALSE;
1602 return; 1604 return;
1603 } 1605 }
1604 1606
1605 *ret = evas_object_image_animated_get(elm_image_object_get(obj)); 1607 if (ret) *ret = evas_object_image_animated_get(elm_image_object_get(obj));
1606} 1608}
1607 1609
1608EAPI void 1610EAPI void
@@ -1661,7 +1663,7 @@ _elm_image_smart_animated_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
1661{ 1663{
1662 Eina_Bool *ret = va_arg(*list, Eina_Bool *); 1664 Eina_Bool *ret = va_arg(*list, Eina_Bool *);
1663 Elm_Image_Smart_Data *sd = _pd; 1665 Elm_Image_Smart_Data *sd = _pd;
1664 *ret = sd->anim; 1666 if (ret) *ret = sd->anim;
1665} 1667}
1666 1668
1667EAPI void 1669EAPI void
@@ -1709,7 +1711,7 @@ _elm_image_smart_animated_play_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list
1709{ 1711{
1710 Eina_Bool *ret = va_arg(*list, Eina_Bool *); 1712 Eina_Bool *ret = va_arg(*list, Eina_Bool *);
1711 Elm_Image_Smart_Data *sd = _pd; 1713 Elm_Image_Smart_Data *sd = _pd;
1712 *ret = sd->play; 1714 if (ret) *ret = sd->play;
1713} 1715}
1714 1716
1715static void 1717static void