]> granicus.if.org Git - php/commitdiff
Data manipulation (for big endian transformation) should occur after the
authorIlia Alshanetsky <iliaa@php.net>
Tue, 12 Nov 2002 16:14:18 +0000 (16:14 +0000)
committerIlia Alshanetsky <iliaa@php.net>
Tue, 12 Nov 2002 16:14:18 +0000 (16:14 +0000)
data has been read from file.

ext/standard/image.c

index 806d11a276869ea0bede7dae848d126dd1e2a291..34247e0bcbb7e8efdd0a4c371e135c7328b4ed7e 100644 (file)
@@ -174,14 +174,14 @@ static struct gfxinfo *php_handle_bmp (php_stream * stream TSRMLS_DC)
        result = (struct gfxinfo *) ecalloc (1, sizeof(struct gfxinfo));
 
        php_stream_read(stream, temp, sizeof(temp));
-       
+       php_stream_read(stream, (char*) &dim, sizeof(dim));
+
 #ifdef WORDS_BIGENDIAN
        dim.in_width = (dim.in_width & 0x000000FF) << 24 | (dim.in_width & 0x0000FF00) << 8 | (dim.in_width & 0x00FF0000) >> 8 | (dim.in_width & 0xFF000000) >> 24;
        dim.in_height = (dim.in_height & 0x000000FF) << 24 | (dim.in_height & 0x0000FF00) << 8 | (dim.in_height & 0x00FF0000) >> 8 | (dim.in_height & 0xFF000000) >> 24;
        dim.bits = (dim.bits & 0x00FF) << 8 | (dim.bits & 0xFF00) >> 8;
 #endif 
        
-       php_stream_read(stream, (char*) &dim, sizeof(dim));
        result->width    = dim.in_width;
        result->height   = dim.in_height;
        result->bits     = dim.bits;