Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/FFmpeg/FFmpeg.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2016-08-19 14:07:14 +0300
committerMichael Niedermayer <michael@niedermayer.cc>2016-08-19 15:24:13 +0300
commit9ffe44c5c75c485b4cbb12751e228f18da219df3 (patch)
treeff9d42054c47f6f928328d15797e54f10a9eece1 /libavcodec/indeo2.c
parenta453bbb68f3eec202673728988bba3bc76071761 (diff)
avcodec/indeo2: check ctab
Fixes out of array access Fixes: 6b73fa392ac808f02e95a4e0a5770026/asan_static-oob_1b15f9a_1969_e7778535e5f27225fe0d6ded14721430.AVI Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
Diffstat (limited to 'libavcodec/indeo2.c')
-rw-r--r--libavcodec/indeo2.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/libavcodec/indeo2.c b/libavcodec/indeo2.c
index a58dfa0910..c89845233e 100644
--- a/libavcodec/indeo2.c
+++ b/libavcodec/indeo2.c
@@ -172,6 +172,12 @@ static int ir2_decode_frame(AVCodecContext *avctx,
ltab = buf[0x22] & 3;
ctab = buf[0x22] >> 2;
+
+ if (ctab > 3) {
+ av_log(avctx, AV_LOG_ERROR, "ctab %d is invalid\n", ctab);
+ return AVERROR_INVALIDDATA;
+ }
+
if (s->decode_delta) { /* intraframe */
if ((ret = ir2_decode_plane(s, avctx->width, avctx->height,
p->data[0], p->linesize[0],