]> granicus.if.org Git - php/commit
Fix #72278: getimagesize returning FALSE on valid jpg
authorChristoph M. Becker <cmbecker69@gmx.de>
Sat, 13 Aug 2016 14:02:10 +0000 (16:02 +0200)
committerChristoph M. Becker <cmbecker69@gmx.de>
Sat, 13 Aug 2016 14:14:34 +0000 (16:14 +0200)
commit82df4e263886a0da21a00c98189649287666ba5c
treee77ee1fbcfcc8fc397b94cf9bcccafd9b73c78ab
parentae3b2078eac226c61bc325527e607ad275936d22
Fix #72278: getimagesize returning FALSE on valid jpg

getimagesize() is rather strict about the length of the marker payload data,
and fails if there are extraneous bytes before the next marker. Only a very
special case reported in bug #13213 is catered to.

libjpeg is rather resilient to such corrupted JPEG files, and raises a
recoverable error in this case. Other image processors also accept such
JPEG files, so we adapt getimagesize() to skip (but warn about) such
extraneous bytes.
NEWS
ext/standard/image.c
ext/standard/tests/image/bug13213.phpt
ext/standard/tests/image/bug72278.jpg [new file with mode: 0644]
ext/standard/tests/image/bug72278.phpt [new file with mode: 0644]