diff options
author | Marcus Boerger <helly@php.net> | 2002-03-16 02:46:04 +0000 |
---|---|---|
committer | Marcus Boerger <helly@php.net> | 2002-03-16 02:46:04 +0000 |
commit | 94b6c6e87fe11ba9e4e0b28dc9eb42f775a32820 (patch) | |
tree | 0eb4671cc04779ef0d0efd0095f2e422da8f7e25 | |
parent | 7da30fa08c7fdd18aa3c2625e2ad802df2729368 (diff) | |
download | php-git-94b6c6e87fe11ba9e4e0b28dc9eb42f775a32820.tar.gz |
-use of corrected stream seek
#thanks to Wez!
#image.c no works again
-rw-r--r-- | ext/standard/image.c | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/ext/standard/image.c b/ext/standard/image.c index 63e6a29094..001803417a 100644 --- a/ext/standard/image.c +++ b/ext/standard/image.c @@ -77,11 +77,10 @@ static struct gfxinfo *php_handle_gif (php_stream * stream) { struct gfxinfo *result = NULL; unsigned char a[2]; - char temp[3]; result = (struct gfxinfo *) ecalloc(1, sizeof(struct gfxinfo)); - php_stream_read(stream, temp, sizeof(temp)); /* fseek(fp, 6L, SEEK_SET); */ + php_stream_seek(stream, 3, SEEK_CUR); php_stream_read(stream, a, sizeof(a)); /* fread(a, sizeof(a), 1, fp); */ result->width = (unsigned short)a[0] | (((unsigned short)a[1])<<8); @@ -165,10 +164,9 @@ static struct gfxinfo *php_handle_swf (php_stream * stream) struct gfxinfo *result = NULL; long bits; unsigned char a[32]; - char temp[5]; result = (struct gfxinfo *) ecalloc (1, sizeof (struct gfxinfo)); - php_stream_read(stream, temp, 5); /* fseek(fp, 8L, SEEK_SET); */ + php_stream_seek(stream, 5, SEEK_CUR); php_stream_read(stream, a, sizeof(a)); /* fread(a, sizeof(a), 1, fp); */ bits = php_swf_get_bits (a, 0, 5); @@ -186,12 +184,11 @@ static struct gfxinfo *php_handle_png (php_stream * stream) { struct gfxinfo *result = NULL; unsigned long in_width, in_height; - char temp[8]; unsigned char a[8]; result = (struct gfxinfo *) ecalloc(1, sizeof(struct gfxinfo)); - php_stream_read(stream, temp, sizeof(temp)); /* fseek(fp, 16L, SEEK_SET); */ + php_stream_seek(stream, 8, SEEK_CUR); if((php_stream_read(stream, a, sizeof(a))) <= 0) { in_width = 0; @@ -316,7 +313,7 @@ static unsigned int php_next_marker(php_stream * stream, int last_marker, int co * skip over a variable-length block; assumes proper length marker */ static void php_skip_variable(php_stream * stream) { - size_t length = ((unsigned int)php_read2(stream)) & 0xFFFF; + off_t length = ((unsigned int)php_read2(stream)); length = length-2; if (length) php_stream_seek(stream, (long)length, SEEK_CUR); |