cvs: php4 /ext/standard image.c
| From: | Marcus B�rger | Date: | Sat, 16 Mar 2002 02:23:58 +0000 |
| Subject: | cvs: php4 /ext/standard image.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-10201@lists.php.net to get a copy of this message | ||
helly Fri Mar 15 21:23:58 2002 EDT
Modified files:
/php4/ext/standard image.c
Log:
-new streams
Index: php4/ext/standard/image.c
diff -u php4/ext/standard/image.c:1.47 php4/ext/standard/image.c:1.48
--- php4/ext/standard/image.c:1.47 Fri Mar 15 16:03:05 2002
+++ php4/ext/standard/image.c Fri Mar 15 21:23:57 2002
@@ -16,7 +16,7 @@
| Marcus Boerger <helly@php.net> |
+----------------------------------------------------------------------+
*/
-/* $Id: image.c,v 1.47 2002/03/15 21:03:05 wez Exp $ */
+/* $Id: image.c,v 1.48 2002/03/16 02:23:57 helly Exp $ */
/*
* Based on Daniel Schmitt's imageinfo.c which carried the following
* Copyright notice.
@@ -316,8 +316,10 @@
* skip over a variable-length block; assumes proper length marker */
static void php_skip_variable(php_stream * stream)
{
- size_t length = php_read2(stream);
- php_stream_seek(stream, SEEK_CUR, length-2);
+ size_t length = ((unsigned int)php_read2(stream)) & 0xFFFF;
+
+ length = length-2;
+ if (length) php_stream_seek(stream, (long)length, SEEK_CUR);
}
/* }}} */
@@ -389,7 +391,7 @@
result->channels = php_stream_getc(stream);
if (!info || length<8) /* if we don't want an extanded info -> return */
return result;
- php_stream_seek(stream, SEEK_CUR, length-8);
+ php_stream_seek(stream, length-8, SEEK_CUR);
} else {
php_skip_variable(stream);
}
@@ -572,7 +574,7 @@
php_stream_read(stream, ifd_ptr, 4);
ifd_addr = php_ifd_get32u(ifd_ptr, motorola_intel);
- php_stream_seek(stream, SEEK_CUR, ifd_addr-8);
+ php_stream_seek(stream, ifd_addr-8, SEEK_CUR);
ifd_size = 2;
ifd_data = emalloc(ifd_size);
php_stream_read(stream, ifd_data, 2);