com php-src: * 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: NEW S ext/exif/exif.c ext/exif/tests/bug62523_1 .jpg ext/exif/tests/bug62523_1.phpt ext/e
xif/tests/bug62523_2.phpt ext/exif/tests/bug 72819/bug72819.jpg ext/exif/tests/bug 72819/bug72819.phpt
| From: | Kalle Sommer Nielsen | Date: | Fri, 07 Jul 2017 10:20:05 +0000 |
| Subject: | com php-src: * 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: NEW S ext/exif/exif.c ext/exif/tests/bug62523_1 .jpg ext/exif/tests/bug62523_1.phpt ext/e xif/tests/bug62523_2.phpt ext/exif/tests/bug 72819/bug72819.jpg ext/exif/tests/bug 72819/bug72819.phpt |
||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-98450@lists.php.net to get a copy of this message | ||
Commit: e6903d471e45177c248adfb4f1abdfdd5487d7bf
Author: Kalle Sommer Nielsen <kalle@php.net> Fri, 7 Jul 2017 12:20:05 +0200
Parents: ce4e07e37d09a71b6450de5099506fed29e15f13
Branches: master
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=e6903d471e45177c248adfb4f1abdfdd5487d7bf
Log:
* 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
Bugs:
https://bugs.php.net/72819
https://bugs.php.net/62523
Changed paths:
M NEWS
M ext/exif/exif.c
M ext/exif/tests/bug62523_1.jpg
M ext/exif/tests/bug62523_1.phpt
M ext/exif/tests/bug62523_2.phpt
A ext/exif/tests/bug72819/bug72819.jpg
A ext/exif/tests/bug72819/bug72819.phpt
Diff:
diff --git a/NEWS b/NEWS
index 275e3b8..0c10025 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 d4aa26c..aa903b9 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 9a63d1e..b3c2934 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 d79b544..c1c8d7f 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--
<?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
diff --git a/ext/exif/tests/bug62523_2.phpt b/ext/exif/tests/bug62523_2.phpt
index 689ed06..ddc8ae8 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 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
index 0000000..f71fa31
--- /dev/null
+++ b/ext/exif/tests/bug72819/bug72819.phpt
@@ -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===