diff options
author | Michael Niedermayer <[email protected]> | 2016-08-19 13:07:14 +0200 |
---|---|---|
committer | Michael Niedermayer <[email protected]> | 2016-08-19 14:47:39 +0200 |
commit | 2b135f266dd33dc4955cd95debf2de17b91c3a55 (patch) | |
tree | 42afc7eab5e1ae7db0006553567ec6c94ae62c0d | |
parent | e965fedf7e94b7e50cd11be00fa729ee8faeb21b (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 <[email protected]>
(cherry picked from commit 9ffe44c5c75c485b4cbb12751e228f18da219df3)
Signed-off-by: Michael Niedermayer <[email protected]>
-rw-r--r-- | libavcodec/indeo2.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/libavcodec/indeo2.c b/libavcodec/indeo2.c index 425451c061..5bf33aa90b 100644 --- a/libavcodec/indeo2.c +++ b/libavcodec/indeo2.c @@ -170,6 +170,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], |