helly Sun Oct 9 10:11:44 2005 EDT Added files: /php-src/ext/exif/tests bug34704.jpg bug34704.phpt
Modified files: /php-src/ext/exif exif.c Log: Bugfix #34704 (Infinite recursion due to corrupt JPEG) (Tim Starling) http://cvs.php.net/diff.php/php-src/ext/exif/exif.c?r1=1.173&r2=1.174&ty=u Index: php-src/ext/exif/exif.c diff -u php-src/ext/exif/exif.c:1.173 php-src/ext/exif/exif.c:1.174 --- php-src/ext/exif/exif.c:1.173 Fri Aug 5 10:03:57 2005 +++ php-src/ext/exif/exif.c Sun Oct 9 10:11:41 2005 @@ -17,7 +17,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: exif.c,v 1.173 2005/08/05 14:03:57 hyanantha Exp $ */ +/* $Id: exif.c,v 1.174 2005/10/09 14:11:41 helly Exp $ */ /* ToDos * @@ -115,7 +115,7 @@ }; /* }}} */ -#define EXIF_VERSION "1.4 $Id: exif.c,v 1.173 2005/08/05 14:03:57 hyanantha Exp $" +#define EXIF_VERSION "1.4 $Id: exif.c,v 1.174 2005/10/09 14:11:41 helly Exp $" /* {{{ PHP_MINFO_FUNCTION */ @@ -3032,6 +3032,12 @@ } } /* + * Ignore IFD2 if it purportedly exists + */ + if (section_index == SECTION_THUMBNAIL) { + return FALSE; + } + /* * Hack to make it process IDF1 I hope * There are 2 IDFs, the second one holds the keys (0x0201 and 0x0202) to the thumbnail */ http://cvs.php.net/co.php/php-src/ext/exif/tests/bug34704.phpt?r=1.1&p=1 Index: php-src/ext/exif/tests/bug34704.phpt +++ php-src/ext/exif/tests/bug34704.phpt --TEST-- Bug # 34704 (Infinite recursion due to corrupt JPEG) --SKIPIF-- <?php if (!extension_loaded('exif')) print 'skip exif extension not available';?> --INI-- magic_quotes_runtime=0 output_handler= zlib.output_compression=0 --FILE-- <?php $infile = dirname(__FILE__).'/bug34704.jpg'; var_dump(exif_read_data($infile)); ?> ===DONE=== --EXPECT-- array(7) { ["FileName"]=> string(12) "bug34704.jpg" ["FileDateTime"]=> int(1128866682) ["FileSize"]=> int(9976) ["FileType"]=> int(2) ["MimeType"]=> string(10) "image/jpeg" ["SectionsFound"]=> string(4) "IFD0" ["COMPUTED"]=> array(5) { ["html"]=> string(24) "width="386" height="488"" ["Height"]=> int(488) ["Width"]=> int(386) ["IsColor"]=> int(1) ["ByteOrderMotorola"]=> int(0) } } ===DONE=== -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php