aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2014-08-10 21:59:33 +0200
committerMichael Niedermayer <michaelni@gmx.at>2014-08-10 22:31:02 +0200
commitabc1fa7c5a1dca1345b9471b81cfcda00c56220d (patch)
tree6bed59517761294d57db98d8cd1c5ecbf83b9d46
parentf712d3669e2eed4a57b0e4d85d2902a2036de89e (diff)
downloadffmpeg-abc1fa7c5a1dca1345b9471b81cfcda00c56220d.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) Conflicts: libavcodec/iff.c (cherry picked from commit 656f930160db48e0b7b25069c62abc340e7f0628) Conflicts: libavcodec/iff.c
-rw-r--r--libavcodec/iff.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/libavcodec/iff.c b/libavcodec/iff.c
index 8e7f8cae46..b4b99a5101 100644
--- a/libavcodec/iff.c
+++ b/libavcodec/iff.c
@@ -832,9 +832,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);