emile_image: fix possible segmentation fault in AGRY88

Summary:
 - ptrag is set NULL and is allocated only when prop is rotated.
   but *ptrag = 0xFF00 | ptr[0]; without checking rotation.

Reviewers: jpeg, cedric, Hermet

Reviewed By: Hermet

Subscribers: conr2d

Differential Revision: https://phab.enlightenment.org/D4463
This commit is contained in:
Sungtaek Hong 2016-12-07 13:42:46 +09:00 committed by Hermet Park
parent 68470a50fe
commit 44716502fc
1 changed files with 2 additions and 1 deletions

View File

@ -1860,10 +1860,11 @@ _emile_jpeg_data(Emile_Image *image,
else
{
ptr2 = pixels;
ptrag = pixels;
ptrg = pixels;
}
if (!ptr2 && !ptrg)
if (!ptr2 && !ptrag && !ptrg)
{
*error = EMILE_IMAGE_LOAD_ERROR_RESOURCE_ALLOCATION_FAILED;
goto on_error;