php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Return to Bug #74428
Patch exif.c.patch revision 2017-04-13 06:48 UTC by bradpiccho at gmail dot com

Patch exif.c.patch for EXIF related Bug #74428

Patch version 2017-04-13 06:48 UTC

Return to Bug #74428 | Download this patch
Patch Revisions:

Developer: bradpiccho@gmail.com

diff --git a/ext/exif/exif.c b/ext/exif/exif.c
index b21d1b2..5e37dfe 100644
--- a/ext/exif/exif.c
+++ b/ext/exif/exif.c
@@ -3157,7 +3157,7 @@ static int exif_process_IFD_in_JPEG(image_info_type *ImageInfo, char *dir_start,

        ImageInfo->sections_found |= FOUND_IFD0;

-       if ((dir_start + 2) >= (offset_base+IFDlength)) {
+       if ((dir_start + 2) > (offset_base+IFDlength)) {
                exif_error_docref("exif_read_data#error_ifd" EXIFERR_CC, ImageInfo, E_WARNING, "Illegal IFD size");
                return FALSE;
        }
@@ -3185,7 +3185,7 @@ static int exif_process_IFD_in_JPEG(image_info_type *ImageInfo, char *dir_start,
         * Hack to make it process IDF1 I hope
         * There are 2 IDFs, the second one holds the keys (0x0201 and 0x0202) to the thumbnail
         */
-       if ((dir_start+2+12*de + 4) >= (offset_base+IFDlength)) {
+       if ((dir_start+2+12*de + 4) > (offset_base+IFDlength)) {
                exif_error_docref("exif_read_data#error_ifd" EXIFERR_CC, ImageInfo, E_WARNING, "Illegal IFD size");
                return FALSE;
        }
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Dec 26 10:01:29 2024 UTC