Commit a06254f2 authored by michael's avatar michael

When bswap_32 is a macro, png images fail to decode properly, patch by (Milan...

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


git-svn-id: file:///var/local/repositories/ffmpeg/trunk@3672 9553f0bf-9b14-0410-a0b8-cfaf0461ba5b
parent a25294b0
...@@ -501,12 +501,14 @@ static int decode_frame(AVCodecContext *avctx, ...@@ -501,12 +501,14 @@ static int decode_frame(AVCodecContext *avctx,
if (ret != Z_OK) if (ret != Z_OK)
return -1; return -1;
for(;;) { for(;;) {
int tag32;
if (s->bytestream >= s->bytestream_end) if (s->bytestream >= s->bytestream_end)
goto fail; goto fail;
length = get32(&s->bytestream); length = get32(&s->bytestream);
if (length > 0x7fffffff) if (length > 0x7fffffff)
goto fail; goto fail;
tag = bswap_32(get32(&s->bytestream)); tag32 = get32(&s->bytestream);
tag = bswap_32(tag32);
#ifdef DEBUG #ifdef DEBUG
printf("png: tag=%c%c%c%c length=%u\n", printf("png: tag=%c%c%c%c length=%u\n",
(tag & 0xff), (tag & 0xff),
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment