aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2014-08-10 21:59:33 +0200
committerMichael Niedermayer <michaelni@gmx.at>2014-11-28 18:44:37 +0100
commitf405267493c8baf900195bf7989f371b861041f6 (patch)
treea3023c84dca764b26fe414d1da2ce342e9bd6509
parentf7ed48938a3346e6493fa64bebc7ff242d2c9cfe (diff)
downloadffmpeg-f405267493c8baf900195bf7989f371b861041f6.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.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/libavcodec/iff.c b/libavcodec/iff.c
index 5d69539171..f69b420d1e 100644
--- a/libavcodec/iff.c
+++ b/libavcodec/iff.c
@@ -841,9 +841,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);