Skip to content

Commit f4dd35e

Browse files
nielsdosdevnexen
authored andcommitted
Remove duplicated length check in exif and
remove always false condition from exif The latter condition will never trigger because otherwise the do-while loop wouldn't have exited. Close GH-10402
1 parent 23dab38 commit f4dd35e

File tree

2 files changed

+3
-11
lines changed

2 files changed

+3
-11
lines changed

NEWS

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,9 @@ PHP NEWS
2121
. Implement GH-10217 (Use strlen() for determining the class_name length).
2222
(Dennis Buteyn)
2323

24+
- Exif:
25+
. Removed unneeded codepaths in exif_process_TIFF_in_JPEG(). (nielsdos)
26+
2427
- Fileinfo:
2528
. Upgrade bundled libmagic to 5.43. (Anatol)
2629

ext/exif/exif.c

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -3679,11 +3679,6 @@ static void exif_process_TIFF_in_JPEG(image_info_type *ImageInfo, char *CharBuf,
36793679
return;
36803680
}
36813681

3682-
if (length < 2) {
3683-
exif_error_docref(NULL EXIFERR_CC, ImageInfo, E_WARNING, "Missing TIFF alignment marker");
3684-
return;
3685-
}
3686-
36873682
/* set the thumbnail stuff to nothing so we can test to see if they get set up */
36883683
if (memcmp(CharBuf, "II", 2) == 0) {
36893684
ImageInfo->motorola_intel = 0;
@@ -3810,12 +3805,6 @@ static bool exif_scan_JPEG_header(image_info_type *ImageInfo)
38103805

38113806
fpos = php_stream_tell(ImageInfo->infile);
38123807

3813-
if (marker == 0xff) {
3814-
/* 0xff is legal padding, but if we get that many, something's wrong. */
3815-
exif_error_docref(NULL EXIFERR_CC, ImageInfo, E_WARNING, "To many padding bytes");
3816-
return false;
3817-
}
3818-
38193808
/* Read the length of the section. */
38203809
if ((lh = php_stream_getc(ImageInfo->infile)) == (unsigned int)EOF) {
38213810
EXIF_ERRLOG_CORRUPT(ImageInfo)

0 commit comments

Comments
 (0)