summaryrefslogtreecommitdiff
path: root/libavcodec
diff options
context:
space:
mode:
authorMartin Storsjö <martin@martin.st>2013-09-29 00:38:50 +0300
committerMartin Storsjö <martin@martin.st>2013-09-29 20:01:29 +0300
commit9fb0de86b49e9fb0709a8ad1e1875e35da841887 (patch)
tree3db94eddfadfdeafad53cac70c0dbc84dd7b5d61 /libavcodec
parenta81cad8f86d1feb7e4bfae29e43f3e994935a5c7 (diff)
downloadffmpeg-9fb0de86b49e9fb0709a8ad1e1875e35da841887.tar.gz
pcx: Consume the whole packet if giving up due to missing palette
Previously, we returned 0, meaning successful decoding but 0 bytes consumed, leading to an infinite loop. Reported-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind CC: libav-stable@libav.org Signed-off-by: Martin Storsjö <martin@martin.st>
Diffstat (limited to 'libavcodec')
-rw-r--r--libavcodec/pcx.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/libavcodec/pcx.c b/libavcodec/pcx.c
index a6f9d8d262..fd8bb2a6cb 100644
--- a/libavcodec/pcx.c
+++ b/libavcodec/pcx.c
@@ -181,6 +181,7 @@ static int pcx_decode_frame(AVCodecContext *avctx, void *data, int *got_frame,
}
if (*buf++ != 12) {
av_log(avctx, AV_LOG_ERROR, "expected palette after image data\n");
+ ret = buf_size;
goto end;
}
} else if (nplanes == 1) { /* all packed formats, max. 16 colors */