diff --git a/NEWS b/NEWS index 203ba7f3b10..b784bdc1b5b 100644 --- a/NEWS +++ b/NEWS @@ -21,6 +21,9 @@ PHP NEWS . Implement GH-10217 (Use strlen() for determining the class_name length). (Dennis Buteyn) +- Exif: + . Removed unneeded codepaths in exif_process_TIFF_in_JPEG(). (nielsdos) + - Fileinfo: . Upgrade bundled libmagic to 5.43. (Anatol) diff --git a/ext/exif/exif.c b/ext/exif/exif.c index a6db8745b3a..5d77d950a91 100644 --- a/ext/exif/exif.c +++ b/ext/exif/exif.c @@ -3679,11 +3679,6 @@ static void exif_process_TIFF_in_JPEG(image_info_type *ImageInfo, char *CharBuf, return; } - if (length < 2) { - exif_error_docref(NULL EXIFERR_CC, ImageInfo, E_WARNING, "Missing TIFF alignment marker"); - return; - } - /* set the thumbnail stuff to nothing so we can test to see if they get set up */ if (memcmp(CharBuf, "II", 2) == 0) { ImageInfo->motorola_intel = 0; @@ -3810,12 +3805,6 @@ static bool exif_scan_JPEG_header(image_info_type *ImageInfo) fpos = php_stream_tell(ImageInfo->infile); - if (marker == 0xff) { - /* 0xff is legal padding, but if we get that many, something's wrong. */ - exif_error_docref(NULL EXIFERR_CC, ImageInfo, E_WARNING, "To many padding bytes"); - return false; - } - /* Read the length of the section. */ if ((lh = php_stream_getc(ImageInfo->infile)) == (unsigned int)EOF) { EXIF_ERRLOG_CORRUPT(ImageInfo)