Bug #74428 [NEW]: exif_read_data(): "Illegal IFD size" warning occurs with correct exif format.

From: Date: Thu, 13 Apr 2017 06:47:27 +0000
Subject: Bug #74428 [NEW]: exif_read_data(): "Illegal IFD size" warning occurs with correct exif format.
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-208510@lists.php.net to get a copy of this message
From: bradpiccho at gmail dot com Operating system: Any PHP version: 5.6.30 Package: EXIF related Bug Type: Bug Bug description:exif_read_data(): "Illegal IFD size" warning occurs with correct exif format. Description: ------------ EXIF data that doesn't have any IFD with offset to data value(i.e. all IFDs have less than 4bytes data length values) and thumbnail data is not read correctly by exif_read_data(). sample image: https://gist.githubusercontent.com/yoshitaka-sato/c5b6816231f675806417b1cf2793134e/raw/0a609217ee557c030a79dd09f71700564e30363e/exif_sample.jpg I think the problem is due to the incorrect comparison at line 3188 of ext/exif/exif.c. it seems that the oerator must be ">" instead of ">=". In the same way, I think the comparison at line 3160 must use ">" instead of ">=". Test script: --------------- <?php ini_set('display_errors', 'On'); exif_read_data('./exif_sample.jpg'); ?> -- Edit bug report at https://bugs.php.net/bug.php?id=74428&edit=1 -- Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=74428&r=trysnapshot54 Try a snapshot (PHP 5.5): https://bugs.php.net/fix.php?id=74428&r=trysnapshot55 Try a snapshot (trunk): https://bugs.php.net/fix.php?id=74428&r=trysnapshottrunk Fixed in SVN: https://bugs.php.net/fix.php?id=74428&r=fixed Fixed in release: https://bugs.php.net/fix.php?id=74428&r=alreadyfixed Need backtrace: https://bugs.php.net/fix.php?id=74428&r=needtrace Need Reproduce Script: https://bugs.php.net/fix.php?id=74428&r=needscript Try newer version: https://bugs.php.net/fix.php?id=74428&r=oldversion Not developer issue: https://bugs.php.net/fix.php?id=74428&r=support Expected behavior: https://bugs.php.net/fix.php?id=74428&r=notwrong Not enough info: https://bugs.php.net/fix.php?id=74428&r=notenoughinfo Submitted twice: https://bugs.php.net/fix.php?id=74428&r=submittedtwice register_globals: https://bugs.php.net/fix.php?id=74428&r=globals PHP 4 support discontinued: https://bugs.php.net/fix.php?id=74428&r=php4 Daylight Savings: https://bugs.php.net/fix.php?id=74428&r=dst IIS Stability: https://bugs.php.net/fix.php?id=74428&r=isapi Install GNU Sed: https://bugs.php.net/fix.php?id=74428&r=gnused Floating point limitations: https://bugs.php.net/fix.php?id=74428&r=float No Zend Extensions: https://bugs.php.net/fix.php?id=74428&r=nozend MySQL Configuration Error: https://bugs.php.net/fix.php?id=74428&r=mysqlcfg

« previous php.bugs (#208510) next »