Browse Source

When bswap_32 is a macro, png images fail to decode properly, patch by (Milan Cutka <cutka>at<szm>dot<sk>)

Originally committed as revision 3672 to svn://svn.ffmpeg.org/ffmpeg/trunk
tags/v0.5
Milan Cutka Michael Niedermayer 20 years ago
parent
commit
e20815b396
1 changed files with 3 additions and 1 deletions
  1. +3
    -1
      libavcodec/png.c

+ 3
- 1
libavcodec/png.c View File

@@ -501,12 +501,14 @@ static int decode_frame(AVCodecContext *avctx,
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),


Loading…
Cancel
Save