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>
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