]> granicus.if.org Git - php/commitdiff
* Fixed bug #72819 (EXIF thumbnails not read anymore)
authorKalle Sommer Nielsen <kalle@php.net>
Fri, 7 Jul 2017 10:20:05 +0000 (12:20 +0200)
committerKalle Sommer Nielsen <kalle@php.net>
Fri, 7 Jul 2017 10:20:05 +0000 (12:20 +0200)
* 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

NEWS
ext/exif/exif.c
ext/exif/tests/bug62523_1.jpg
ext/exif/tests/bug62523_1.phpt
ext/exif/tests/bug62523_2.phpt
ext/exif/tests/bug72819/bug72819.jpg [new file with mode: 0644]
ext/exif/tests/bug72819/bug72819.phpt [new file with mode: 0644]

diff --git a/NEWS b/NEWS
index 275e3b8650b950c36c84747a65b23930ccdaf294..0c100252998d08b7e6a5d4989db2d7d20ba163f8 100644 (file)
--- 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)
 
index d4aa26c700ef653184bd2adb1db99032ef7fc819..aa903b96b04c39f75e1711c6e5cb9fbf95439c5d 100644 (file)
@@ -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},
index 9a63d1e84d90b1e8cc3fe8b3367604cd42819b48..b3c2934d96a9aa53f6fe7733d6c199211efaabec 100644 (file)
Binary files a/ext/exif/tests/bug62523_1.jpg and b/ext/exif/tests/bug62523_1.jpg differ
index d79b544eb0342db900de9f4b3f43ba9f147cb3e2..c1c8d7ff8b8831427659494d5f8b443d23ee6094 100644 (file)
@@ -7,12 +7,10 @@ extension_loaded("exif") or die("skip need exif");
 --FILE--
 <?php
 echo "Test\n";
-var_dump(exif_read_data(__DIR__."/bug62523_1.jpg"));
+var_dump(count(exif_read_data(__DIR__."/bug62523_1.jpg")));
 ?>
 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
index 689ed0679dffd5cafe718a67f369a44c0440e364..ddc8ae824e82e0b88d2d847b2bc8629f8e7b109b 100644 (file)
@@ -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 (file)
index 0000000..933719d
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 (file)
index 0000000..f71fa31
--- /dev/null
@@ -0,0 +1,16 @@
+--TEST--
+Bug #72819 (EXIF thumbnails not read anymore)
+--SKIPIF--
+<?php if (!extension_loaded('exif')) print 'skip exif extension not available';?>
+--INI--
+output_handler=
+zlib.output_compression=0 
+--FILE--
+<?php
+$infile = dirname(__FILE__).'/bug72819.jpg';
+var_dump(strlen(exif_thumbnail($infile)));
+?>
+===DONE===
+--EXPECT--
+int(5448)
+===DONE===