diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2013-09-30 01:54:59 +0200 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2013-09-30 01:54:59 +0200 |
commit | bbe50a8001ade24618685f6cacefc5d49a2e003c (patch) | |
tree | 24a211e402ad41f04a959049000229d6333f1284 /libavcodec/pcx.c | |
parent | c955bac7d5c1984dcb06539fe61844b7c09b72b4 (diff) | |
parent | ff07ec143ebd3833fd5a3f4b6c00474ac523a31f (diff) | |
download | ffmpeg-bbe50a8001ade24618685f6cacefc5d49a2e003c.tar.gz |
Merge commit 'ff07ec143ebd3833fd5a3f4b6c00474ac523a31f'
* commit 'ff07ec143ebd3833fd5a3f4b6c00474ac523a31f':
pcx: Return an error on broken palette if err_detect is set to 'explode'
Conflicts:
libavcodec/pcx.c
Merged-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec/pcx.c')
-rw-r--r-- | libavcodec/pcx.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/libavcodec/pcx.c b/libavcodec/pcx.c index d024e4cd90..835dcfeb0a 100644 --- a/libavcodec/pcx.c +++ b/libavcodec/pcx.c @@ -165,7 +165,8 @@ static int pcx_decode_frame(AVCodecContext *avctx, void *data, int *got_frame, if (avpkt->size < 769) { av_log(avctx, AV_LOG_ERROR, "File is too short\n"); - ret = avpkt->size; + ret = avctx->err_recognition & AV_EF_EXPLODE ? + AVERROR_INVALIDDATA : avpkt->size; goto end; } @@ -180,7 +181,8 @@ static int pcx_decode_frame(AVCodecContext *avctx, void *data, int *got_frame, } if (bytestream2_get_byte(&gb) != 12) { av_log(avctx, AV_LOG_ERROR, "expected palette after image data\n"); - ret = avpkt->size; + ret = avctx->err_recognition & AV_EF_EXPLODE ? + AVERROR_INVALIDDATA : avpkt->size; goto end; } } else if (nplanes == 1) { /* all packed formats, max. 16 colors */ |