cvs: php4 /ext/standard image.c

From: Date: Sat, 16 Mar 2002 02:46:04 +0000
Subject: cvs: php4 /ext/standard image.c
Groups: php.cvs 
Request: Send a blank email to php-cvs+get-10204@lists.php.net to get a copy of this message
helly Fri Mar 15 21:46:04 2002 EDT Modified files: /php4/ext/standard image.c Log: -use of corrected stream seek #thanks to Wez! #image.c no works again Index: php4/ext/standard/image.c diff -u php4/ext/standard/image.c:1.48 php4/ext/standard/image.c:1.49 --- php4/ext/standard/image.c:1.48 Fri Mar 15 21:23:57 2002 +++ php4/ext/standard/image.c Fri Mar 15 21:46:04 2002 @@ -16,7 +16,7 @@ | Marcus Boerger <helly@php.net> | +----------------------------------------------------------------------+ */ -/* $Id: image.c,v 1.48 2002/03/16 02:23:57 helly Exp $ */ +/* $Id: image.c,v 1.49 2002/03/16 02:46:04 helly Exp $ */ /* * Based on Daniel Schmitt's imageinfo.c which carried the following * Copyright notice. @@ -77,11 +77,10 @@ { 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 @@ 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 @@ { 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 @@ * 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);

« previous php.cvs (#10204) next »