forked from enlightenment/efl
evas: fix to load BMP file compressed with RLE.
Summary: If the file size of RLE compressed image is bigger than original image, BMP loader doesn't work as well. @fix Reviewers: Hermet, cedric Subscribers: cedric Differential Revision: https://phab.enlightenment.org/D1892 Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
This commit is contained in:
parent
311ea67b65
commit
0a758d10c9
|
@ -563,7 +563,11 @@ evas_image_load_file_data_bmp(void *loader_data,
|
|||
position = header.offset;
|
||||
|
||||
if ((scale_ratio == 1) || (header.comp !=0))
|
||||
buffer = malloc(image_size + 8); // add 8 for padding to avoid checks
|
||||
{
|
||||
if (image_size < fsize - position)
|
||||
image_size = fsize - position;
|
||||
buffer = malloc(image_size + 8); // add 8 for padding to avoid checks
|
||||
}
|
||||
else
|
||||
{
|
||||
scale_surface = malloc(image_w * sizeof(DATA32)); //for one line decoding
|
||||
|
|
Loading…
Reference in New Issue