From: Kalle Sommer Nielsen Date: Fri, 7 Jul 2017 10:20:05 +0000 (+0200) Subject: * Fixed bug #72819 (EXIF thumbnails not read anymore) X-Git-Tag: php-7.2.0beta1~124 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=e6903d471e45177c248adfb4f1abdfdd5487d7bf;p=php * Fixed bug #72819 (EXIF thumbnails not read anymore) * Fixed bug #62523 (php crashes with segfault when exif_read_data called) * Fixed the poor test case for #62523, which was a HTML document Fixing #72819 had the side effect of fixing #62523 by supporting the format as seen in bug62523_1.phpt --- diff --git a/NEWS b/NEWS index 275e3b8650..0c10025299 100644 --- a/NEWS +++ b/NEWS @@ -13,6 +13,9 @@ PHP NEWS - EXIF: . Fixed bug #74428 (exif_read_data(): "Illegal IFD size" warning occurs with correct exif format). (bradpiccho at gmail dot com, Kalle) + . Fixed bug #72819 (EXIF thumbnails not read anymore). (Kalle) + . Fixed bug #62523 (php crashes with segfault when exif_read_data called). + (Kalle) . Fixed bug #50660 (exif_read_data(): Illegal IFD offset (works fine with other exif readers). (skinny dot bravo at gmail dot com, Kalle) diff --git a/ext/exif/exif.c b/ext/exif/exif.c index d4aa26c700..aa903b96b0 100644 --- a/ext/exif/exif.c +++ b/ext/exif/exif.c @@ -1357,7 +1357,7 @@ typedef struct { /* Remember to update PHP_MINFO if updated */ static const maker_note_type maker_note_array[] = { - { tag_table_VND_CANON, "Canon", NULL, NULL, 0, 0, MN_ORDER_INTEL, MN_OFFSET_GUESS}, + { tag_table_VND_CANON, "Canon", NULL, NULL, 0, 0, MN_ORDER_INTEL, MN_OFFSET_NORMAL}, { tag_table_VND_CASIO, "CASIO", NULL, NULL, 0, 0, MN_ORDER_MOTOROLA, MN_OFFSET_NORMAL}, { tag_table_VND_FUJI, "FUJIFILM", NULL, "FUJIFILM\x0C\x00\x00\x00", 12, 12, MN_ORDER_INTEL, MN_OFFSET_MAKER}, { tag_table_VND_NIKON, "NIKON", NULL, "Nikon\x00\x01\x00", 8, 8, MN_ORDER_NORMAL, MN_OFFSET_NORMAL}, diff --git a/ext/exif/tests/bug62523_1.jpg b/ext/exif/tests/bug62523_1.jpg index 9a63d1e84d..b3c2934d96 100644 Binary files a/ext/exif/tests/bug62523_1.jpg and b/ext/exif/tests/bug62523_1.jpg differ diff --git a/ext/exif/tests/bug62523_1.phpt b/ext/exif/tests/bug62523_1.phpt index d79b544eb0..c1c8d7ff8b 100644 --- a/ext/exif/tests/bug62523_1.phpt +++ b/ext/exif/tests/bug62523_1.phpt @@ -7,12 +7,10 @@ extension_loaded("exif") or die("skip need exif"); --FILE-- Done ---EXPECTF-- +--EXPECT-- Test - -Warning: exif_read_data(bug62523_1.jpg): File not supported in %sbug62523_1.php on line %d -bool(false) +int(86) Done diff --git a/ext/exif/tests/bug62523_2.phpt b/ext/exif/tests/bug62523_2.phpt index 689ed0679d..ddc8ae824e 100644 --- a/ext/exif/tests/bug62523_2.phpt +++ b/ext/exif/tests/bug62523_2.phpt @@ -10,9 +10,7 @@ echo "Test\n"; var_dump(count(exif_read_data(__DIR__."/bug62523_2.jpg"))); ?> Done ---EXPECTF-- +--EXPECT-- Test - -Warning: exif_read_data(bug62523_2.jpg): IFD data bad offset: 0xADB23672 length 0x0D94 in %s%ebug62523_2.php on line %d -int(30) +int(76) Done diff --git a/ext/exif/tests/bug72819/bug72819.jpg b/ext/exif/tests/bug72819/bug72819.jpg new file mode 100644 index 0000000000..933719d1cf Binary files /dev/null and b/ext/exif/tests/bug72819/bug72819.jpg differ diff --git a/ext/exif/tests/bug72819/bug72819.phpt b/ext/exif/tests/bug72819/bug72819.phpt new file mode 100644 index 0000000000..f71fa31663 --- /dev/null +++ b/ext/exif/tests/bug72819/bug72819.phpt @@ -0,0 +1,16 @@ +--TEST-- +Bug #72819 (EXIF thumbnails not read anymore) +--SKIPIF-- + +--INI-- +output_handler= +zlib.output_compression=0 +--FILE-- + +===DONE=== +--EXPECT-- +int(5448) +===DONE===