Commit 9fb0de86 authored by Martin Storsjö's avatar Martin Storsjö

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: 's avatarMartin Storsjö <martin@martin.st>
parent a81cad8f
...@@ -181,6 +181,7 @@ static int pcx_decode_frame(AVCodecContext *avctx, void *data, int *got_frame, ...@@ -181,6 +181,7 @@ static int pcx_decode_frame(AVCodecContext *avctx, void *data, int *got_frame,
} }
if (*buf++ != 12) { if (*buf++ != 12) {
av_log(avctx, AV_LOG_ERROR, "expected palette after image data\n"); av_log(avctx, AV_LOG_ERROR, "expected palette after image data\n");
ret = buf_size;
goto end; goto end;
} }
} else if (nplanes == 1) { /* all packed formats, max. 16 colors */ } else if (nplanes == 1) { /* all packed formats, max. 16 colors */
......
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