evas: Make safety check more lenient
authorJean-Philippe Andre <jp.andre@samsung.com>
Fri, 5 Aug 2016 01:59:48 +0000 (10:59 +0900)
committerJean-Philippe Andre <jp.andre@samsung.com>
Fri, 5 Aug 2016 02:01:55 +0000 (11:01 +0900)
This is to avoid ERR messages such as "object is not an image!"
that can happen when a legacy image function is called on an
eo image (proxy, 3d, ...) object.

Note: This does not fix any known issue, but it's probably a safer
solution.

src/lib/evas/canvas/evas_image_legacy.c

index e682041..9134a8f 100644 (file)
@@ -4,7 +4,7 @@
 #include "evas_image.eo.h"
 
 #define EVAS_IMAGE_API(_o, ...) do { \
-   if (EINA_UNLIKELY(!eo_isa(_o, EVAS_IMAGE_CLASS))) { \
+   if (EINA_UNLIKELY(!eo_isa(_o, EFL_CANVAS_IMAGE_INTERNAL_CLASS))) { \
       EINA_SAFETY_ERROR("object is not an image!"); \
       return __VA_ARGS__; \
    } } while (0)