summaryrefslogtreecommitdiff
path: root/src/modules
diff options
context:
space:
mode:
authorjiin.moon <jiin.moon@samsung.com>2015-01-26 11:02:58 +0100
committerCedric BAIL <cedric@osg.samsung.com>2015-01-26 11:21:37 +0100
commit0a758d10c9f115def7043aed93547bf4876f99fe (patch)
treea459ec5f44341fa19ff71c830c008886713a6be0 /src/modules
parent311ea67b65814d73a9231c3376f2a69388e1b973 (diff)
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>
Diffstat (limited to 'src/modules')
-rw-r--r--src/modules/evas/image_loaders/bmp/evas_image_load_bmp.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/modules/evas/image_loaders/bmp/evas_image_load_bmp.c b/src/modules/evas/image_loaders/bmp/evas_image_load_bmp.c
index d54cfdc8f6..cf8156dc20 100644
--- a/src/modules/evas/image_loaders/bmp/evas_image_load_bmp.c
+++ b/src/modules/evas/image_loaders/bmp/evas_image_load_bmp.c
@@ -563,7 +563,11 @@ evas_image_load_file_data_bmp(void *loader_data,
563 position = header.offset; 563 position = header.offset;
564 564
565 if ((scale_ratio == 1) || (header.comp !=0)) 565 if ((scale_ratio == 1) || (header.comp !=0))
566 buffer = malloc(image_size + 8); // add 8 for padding to avoid checks 566 {
567 if (image_size < fsize - position)
568 image_size = fsize - position;
569 buffer = malloc(image_size + 8); // add 8 for padding to avoid checks
570 }
567 else 571 else
568 { 572 {
569 scale_surface = malloc(image_w * sizeof(DATA32)); //for one line decoding 573 scale_surface = malloc(image_w * sizeof(DATA32)); //for one line decoding