Skip to content

Commit eba4140

Browse files
committed
exif/heic: Ensure file is at least 16 bytes to prevent underflow
1 parent 9c90114 commit eba4140

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

ext/exif/exif.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4507,7 +4507,7 @@ static bool exif_scan_FILE_header(image_info_type *ImageInfo)
45074507
exif_error_docref(NULL EXIFERR_CC, ImageInfo, E_WARNING, "Invalid TIFF file");
45084508
return false;
45094509
}
4510-
} else if ((ImageInfo->FileSize > 12) &&
4510+
} else if ((ImageInfo->FileSize > 16) &&
45114511
(!memcmp(file_header + 4, "ftyp", 4)) &&
45124512
(exif_read_from_stream_file_looped(ImageInfo->infile, (char*)(file_header + 8), 4) == 4) &&
45134513
((!memcmp(file_header + 8, "heic", 4)) || (!memcmp(file_header + 8, "heix", 4)) || (!memcmp(file_header + 8, "mif1", 4)))) {

0 commit comments

Comments
 (0)