oops somehow missed this commit - part of adding wbmp support. limit
authorraster <raster@7cbeb6ba-43b4-40fd-8cce-4c39aea84d33>
Mon, 7 Feb 2011 23:06:22 +0000 (23:06 +0000)
committerraster <raster@7cbeb6ba-43b4-40fd-8cce-4c39aea84d33>
Mon, 7 Feb 2011 23:06:22 +0000 (23:06 +0000)
image size macro used. (so no point with a changelog - part of existing).

git-svn-id: svn+ssh://svn.enlightenment.org/var/svn/e/trunk/evas@56791 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33

src/modules/loaders/wbmp/evas_image_load_wbmp.c

index d216391..393d6da 100644 (file)
@@ -68,6 +68,13 @@ evas_image_load_file_head_wbmp(Image_Entry *ie, const char *file, const char *ke
    if (fread(&fixed_header, 1, 1, f) != 1) goto bail;
    if (read_mb(&w, f) < 0) goto bail;
    if (read_mb(&h, f) < 0) goto bail;
+   if ((w < 1) || (h < 1) || (w > IMG_MAX_SIZE) || (h > IMG_MAX_SIZE) ||
+       IMG_TOO_BIG(w, h))
+     {
+        *error = EVAS_LOAD_ERROR_RESOURCE_ALLOCATION_FAILED;
+        goto bail;
+     }
+      
    fclose(f);
    ie->w = w;
    ie->h = h;