warning--
authorraster <raster@7cbeb6ba-43b4-40fd-8cce-4c39aea84d33>
Sat, 18 Sep 2010 23:39:30 +0000 (23:39 +0000)
committerraster <raster@7cbeb6ba-43b4-40fd-8cce-4c39aea84d33>
Sat, 18 Sep 2010 23:39:30 +0000 (23:39 +0000)
git-svn-id: http://svn.enlightenment.org/svn/e/trunk/evas@52430 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33

src/modules/loaders/png/evas_image_load_png.c
src/modules/loaders/tiff/evas_image_load_tiff.c

index 24ed652..27f248d 100644 (file)
@@ -150,7 +150,11 @@ evas_image_load_file_data_png(Image_Entry *ie, const char *file, const char *key
      }
 
    /* if we havent read the header before, set the header data */
-   E_FREAD(buf, 1, PNG_BYTES_TO_CHECK, f);
+   if (E_FREAD(buf, 1, PNG_BYTES_TO_CHECK, f) != 1)
+     {
+        *error = EVAS_LOAD_ERROR_CORRUPT_FILE;
+        goto close_file;
+     }
    if (png_sig_cmp(buf, 0, PNG_BYTES_TO_CHECK))
      {
        *error = EVAS_LOAD_ERROR_CORRUPT_FILE;
index c5ef0c9..6aa6675 100644 (file)
@@ -233,7 +233,12 @@ evas_image_load_file_data_tiff(Image_Entry *ie, const char *file, const char *ke
        return EINA_FALSE;
      }
 
-   fread(&magic_number, sizeof(uint16), 1, ffile);
+   if (fread(&magic_number, sizeof(uint16), 1, ffile) != 1)
+     {
+        fclose(ffile);
+       *error = EVAS_LOAD_ERROR_CORRUPT_FILE;
+       return EINA_FALSE;
+     }
    /* Apparently rewind(f) isn't sufficient */
    fseek(ffile, (long)0, SEEK_SET);
 
@@ -241,7 +246,7 @@ evas_image_load_file_data_tiff(Image_Entry *ie, const char *file, const char *ke
        && (magic_number != TIFF_LITTLEENDIAN))
      {
         fclose(ffile);
-       *error = EVAS_LOAD_ERROR_GENERIC;
+       *error = EVAS_LOAD_ERROR_CORRUPT_FILE;
        return EINA_FALSE;
      }