evas: Fix crash in E
authorJean-Philippe Andre <jp.andre@samsung.com>
Thu, 10 Aug 2017 02:48:01 +0000 (11:48 +0900)
committerJean-Philippe Andre <jp.andre@samsung.com>
Thu, 10 Aug 2017 02:51:56 +0000 (11:51 +0900)
Somehow starting VirtualBox would crash E when trying to upload invalid
data. I believe checking for NULL data here is all we need to do in
order to keep the image data consistent and valid.

I have to admit I'm not 100% sure what is happening here.

Fixes T5868

@fix

src/lib/evas/canvas/evas_image_legacy.c

index 3f69dca..dd6e579 100644 (file)
@@ -694,7 +694,7 @@ evas_object_image_data_get(const Eo *eo_obj, Eina_Bool for_writing)
    pixels = ENFN->image_data_get(ENDT, o->engine_data, for_writing, &data, &o->load_error, &tofree);
 
    /* if we fail to get engine_data, we have to return NULL */
-   if (!pixels) return NULL;
+   if (!pixels || !data) goto error;
 
    if (!tofree)
      {