HomePhabricator

evas: Prevent crash with image_data_get

Authored by Jean-Philippe Andre <jp.andre@samsung.com> on Oct 18 2017, 5:40 AM.

Description

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

Jean-Philippe Andre <jp.andre@samsung.com> committed rEFL98622623a086: evas: Prevent crash with image_data_get (authored by Jean-Philippe Andre <jp.andre@samsung.com>).Oct 18 2017, 6:12 AM