diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2014-08-10 21:59:33 +0200 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2014-08-10 22:40:50 +0200 |
commit | 83956309cc16b47fbf8548e8c5bcf67b8cd4b65f (patch) | |
tree | 3d1a229a432f663106874c62b778c659ca3fef82 | |
parent | ed15be7519af8aa68bdf58ccdf39915b560d11a2 (diff) | |
download | ffmpeg-83956309cc16b47fbf8548e8c5bcf67b8cd4b65f.tar.gz |
avcodec/iff: check pixfmt for rgb8 / rgbn
Fixes out of array access
Found-by: Piotr Bandurski <ami_stuff@o2.pl>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 3539d6c63a16e1b2874bb037a86f317449c58770)
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
-rw-r--r-- | libavcodec/iff.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/libavcodec/iff.c b/libavcodec/iff.c index f08a0f70ce..d93015c0c3 100644 --- a/libavcodec/iff.c +++ b/libavcodec/iff.c @@ -847,9 +847,9 @@ static int decode_frame(AVCodecContext *avctx, break; case 4: bytestream2_init(&gb, buf, buf_size); - if (avctx->codec_tag == MKTAG('R', 'G', 'B', '8')) + if (avctx->codec_tag == MKTAG('R', 'G', 'B', '8') && avctx->pix_fmt == AV_PIX_FMT_RGB32) decode_rgb8(&gb, s->frame->data[0], avctx->width, avctx->height, s->frame->linesize[0]); - else if (avctx->codec_tag == MKTAG('R', 'G', 'B', 'N')) + else if (avctx->codec_tag == MKTAG('R', 'G', 'B', 'N') && avctx->pix_fmt == AV_PIX_FMT_RGB444) decode_rgbn(&gb, s->frame->data[0], avctx->width, avctx->height, s->frame->linesize[0]); else return unsupported(avctx); |