tony2001 Mon Feb 12 20:30:52 2007 UTC
Modified files: (Branch: PHP_5_2)
/php-src NEWS
/php-src/ext/standard iptc.c
Log:
MFH: fix #40109 (iptcembed fails on non-jfif jpegs)
http://cvs.php.net/viewvc.cgi/php-src/NEWS?r1=1.2027.2.547.2.532&r2=1.2027.2.547.2.533&diff_format=u
Index: php-src/NEWS
diff -u php-src/NEWS:1.2027.2.547.2.532 php-src/NEWS:1.2027.2.547.2.533
--- php-src/NEWS:1.2027.2.547.2.532 Mon Feb 12 08:57:41 2007
+++ php-src/NEWS Mon Feb 12 20:30:51 2007
@@ -9,6 +9,7 @@
methods). (Tony)
- Fixed bug #40428 (imagepstext() doesn't accept optional parameter). (Pierre)
- Fixed bug #40410 (ext/posix does not compile on MacOS 10.3.9). (Tony)
+- Fixed bug #40109 (iptcembed fails on non-jfif jpegs). (Tony)
- Fixed bug #39836 (SplObjectStorage empty after unserialize). (Marcus)
08 Feb 2007, PHP 5.2.1
http://cvs.php.net/viewvc.cgi/php-src/ext/standard/iptc.c?r1=1.50.2.2.2.2&r2=1.50.2.2.2.3&diff_format=u
Index: php-src/ext/standard/iptc.c
diff -u php-src/ext/standard/iptc.c:1.50.2.2.2.2
php-src/ext/standard/iptc.c:1.50.2.2.2.3
--- php-src/ext/standard/iptc.c:1.50.2.2.2.2 Mon Jan 1 09:36:08 2007
+++ php-src/ext/standard/iptc.c Mon Feb 12 20:30:52 2007
@@ -16,7 +16,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: iptc.c,v 1.50.2.2.2.2 2007/01/01 09:36:08 sebastian Exp $ */
+/* $Id: iptc.c,v 1.50.2.2.2.3 2007/02/12 20:30:52 tony2001 Exp $ */
/*
* Functions to parse & compse IPTC data.
@@ -183,6 +183,7 @@
unsigned int spool = 0, done = 0, inx, len;
unsigned char *spoolbuf=0, *poi=0;
struct stat sb;
+ zend_bool written = 0;
switch(ZEND_NUM_ARGS()){
case 3:
@@ -226,7 +227,8 @@
if (spool < 2) {
fstat(fileno(fp), &sb);
- poi = spoolbuf = emalloc(len + sizeof(psheader) + sb.st_size +
1024);
+ poi = spoolbuf = safe_emalloc(1, len + sizeof(psheader) +
sb.st_size + 1024, 1);
+ memset(poi, 0, len + sizeof(psheader) + sb.st_size + 1024 + 1);
}
if (php_iptc_get1(fp, spool, poi?&poi:0 TSRMLS_CC) != 0xFF) {
@@ -264,6 +266,13 @@
case M_APP0:
/* APP0 is in each and every JPEG, so when we
hit APP0 we insert our new APP13! */
+ case M_APP1:
+ if (written) {
+ /* don't try to write the data twice */
+ break;
+ }
+ written = 1;
+
php_iptc_skip_variable(fp, spool, poi?&poi:0
TSRMLS_CC);
if (len & 1) len++; /* make the length even */
--
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php