forked from enlightenment/efl
parent
89038e3b0c
commit
5d15f41500
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue