From b2004aebc59e2e35df769d217a06f3d8d14ddff6 Mon Sep 17 00:00:00 2001 From: Jiyoun Park Date: Wed, 12 Sep 2012 16:34:45 +0000 Subject: [PATCH] fix bmp decoding error. other tool like GIMP can handle image size error SVN revision: 76546 --- legacy/evas/src/modules/loaders/bmp/evas_image_load_bmp.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/legacy/evas/src/modules/loaders/bmp/evas_image_load_bmp.c b/legacy/evas/src/modules/loaders/bmp/evas_image_load_bmp.c index 9453ceb64f..562f17227c 100644 --- a/legacy/evas/src/modules/loaders/bmp/evas_image_load_bmp.c +++ b/legacy/evas/src/modules/loaders/bmp/evas_image_load_bmp.c @@ -456,7 +456,7 @@ evas_image_load_file_data_bmp(Image_Entry *ie, const char *file, const char *key if (!read_int(map, fsize, &position, &tmp2)) goto close_file; comp = tmp2; // compression method if (!read_int(map, fsize, &position, &tmp2)) goto close_file; - image_size = tmp2; // bitmap data size + if (tmp2 <= image_size) image_size = tmp2; // bitmap data size, GIMP can handle image size error if (!read_int(map, fsize, &position, &tmp2)) goto close_file; //hdpi = (tmp2 * 254) / 10000; // horizontal pixels/meter if (!read_int(map, fsize, &position, &tmp2)) goto close_file; @@ -484,7 +484,7 @@ evas_image_load_file_data_bmp(Image_Entry *ie, const char *file, const char *key if (!read_int(map, fsize, &position, &tmp2)) goto close_file; comp = tmp2; // compression method if (!read_int(map, fsize, &position, &tmp2)) goto close_file; - image_size = tmp2; // bitmap data size + if (tmp2 <= image_size) image_size = tmp2; // bitmap data size, GIMP can handle image size error if (!read_int(map, fsize, &position, &tmp2)) goto close_file; //hdpi = (tmp2 * 254) / 10000; // horizontal pixels/meter if (!read_int(map, fsize, &position, &tmp2)) goto close_file; @@ -512,7 +512,7 @@ evas_image_load_file_data_bmp(Image_Entry *ie, const char *file, const char *key if (!read_int(map, fsize, &position, &tmp2)) goto close_file; comp = tmp2; // compression method if (!read_int(map, fsize, &position, &tmp2)) goto close_file; - image_size = tmp2; // bitmap data size + if (tmp2 <= image_size) image_size = tmp2; // bitmap data size, GIMP can handle image size error if (!read_int(map, fsize, &position, &tmp2)) goto close_file; //hdpi = (tmp2 * 254) / 10000; // horizontal pixels/meter if (!read_int(map, fsize, &position, &tmp2)) goto close_file; @@ -550,7 +550,7 @@ evas_image_load_file_data_bmp(Image_Entry *ie, const char *file, const char *key if (!read_int(map, fsize, &position, &tmp2)) goto close_file; comp = tmp2; // compression method if (!read_int(map, fsize, &position, &tmp2)) goto close_file; - image_size = tmp2; // bitmap data size + if (tmp2 <= image_size) image_size = tmp2; // bitmap data size, GIMP can handle image size error if (!read_int(map, fsize, &position, &tmp2)) goto close_file; //hdpi = (tmp2 * 254) / 10000; // horizontal pixels/meter if (!read_int(map, fsize, &position, &tmp2)) goto close_file;