changeset 2347:c6280d48be02 libavcodec

When bswap_32 is a macro, png images fail to decode properly, patch by (Milan Cutka <cutka>at<szm>dot<sk>)
author michael
date Fri, 12 Nov 2004 09:48:06 +0000
parents 424e6b29de74
children d02fb928ca44
files png.c
diffstat 1 files changed, 3 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/png.c	Fri Nov 12 02:05:26 2004 +0000
+++ b/png.c	Fri Nov 12 09:48:06 2004 +0000
@@ -501,12 +501,14 @@
     if (ret != Z_OK)
         return -1;
     for(;;) {
+        int tag32;
         if (s->bytestream >= s->bytestream_end)
             goto fail;
         length = get32(&s->bytestream);
         if (length > 0x7fffffff)
             goto fail;
-        tag = bswap_32(get32(&s->bytestream));
+        tag32 = get32(&s->bytestream);
+        tag = bswap_32(tag32);
 #ifdef DEBUG
         printf("png: tag=%c%c%c%c length=%u\n", 
                (tag & 0xff),