evas: Prevent crash with image_data_get
authorJean-Philippe Andre <jp.andre@samsung.com>
Wed, 18 Oct 2017 12:40:01 +0000 (21:40 +0900)
committerJean-Philippe Andre <jp.andre@samsung.com>
Wed, 18 Oct 2017 13:12:57 +0000 (22:12 +0900)
commit98622623a0865c525ede12ef5759ab6f5b3af407
treec0740452d4d743be2ad17a0b3b7adc9fd40f32a9
parentdfd98b3e48a02c35fbbe14b709cbe72e65ea9500
evas: Prevent crash with image_data_get

If the image has no data, it may get an allocated surface of 1x1 but it
is not sane to return the pointer to that data, as the user would expect
a normally sized image (in my case, 1920x1080).

I do not fully understand what is going on with this image. But at least
this transforms a crash into a simple ERR in ~/.xessions-errors

Two similar crashes happened:
 - SIGSEGV by writing data outside of the image data
 - abort() in free() because the malloc metadata has been overridden
   when writing outside of the image data (newly allocated 1x1).

Fixes T5957

@fix
src/modules/evas/engines/gl_generic/evas_engine.c