Commit ff07ec14 authored by Martin Storsjö's avatar Martin Storsjö

pcx: Return an error on broken palette if err_detect is set to 'explode'

Signed-off-by: 's avatarMartin Storsjö <martin@martin.st>
parent d1d99e3b
...@@ -171,7 +171,8 @@ static int pcx_decode_frame(AVCodecContext *avctx, void *data, int *got_frame, ...@@ -171,7 +171,8 @@ static int pcx_decode_frame(AVCodecContext *avctx, void *data, int *got_frame,
if (buf_size < 769) { if (buf_size < 769) {
av_log(avctx, AV_LOG_ERROR, "File is too short\n"); av_log(avctx, AV_LOG_ERROR, "File is too short\n");
ret = buf_size; ret = avctx->err_recognition & AV_EF_EXPLODE ?
AVERROR_INVALIDDATA : buf_size;
goto end; goto end;
} }
...@@ -187,7 +188,8 @@ static int pcx_decode_frame(AVCodecContext *avctx, void *data, int *got_frame, ...@@ -187,7 +188,8 @@ 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; ret = avctx->err_recognition & AV_EF_EXPLODE ?
AVERROR_INVALIDDATA : 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