diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2011-11-18 18:08:31 +0100 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2011-11-21 18:31:23 +0100 |
commit | fa5292d9d42f10841e3a889bca4ebd878c965268 (patch) | |
tree | dfb348eeaa05f331b53e2cd31f4d6e30b9d257d4 | |
parent | a6a61a6d1d4da219a6fe29250e2a6b28f9d05524 (diff) | |
download | ffmpeg-fa5292d9d42f10841e3a889bca4ebd878c965268.tar.gz |
vp3dec: Check coefficient index in vp3_dequant()
Fixes NGS00145
Found-by: Phillip Langlois
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit eef5c35b4352ec49ca41f6198bee8a976b1f81e5)
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
-rw-r--r-- | libavcodec/vp3.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/libavcodec/vp3.c b/libavcodec/vp3.c index 549f494ff6..2f07af8c4b 100644 --- a/libavcodec/vp3.c +++ b/libavcodec/vp3.c @@ -1308,6 +1308,10 @@ static inline int vp3_dequant(Vp3DecodeContext *s, Vp3Fragment *frag, case 1: // zero run s->dct_tokens[plane][i]++; i += (token >> 2) & 0x7f; + if(i>63){ + av_log(s->avctx, AV_LOG_ERROR, "Coefficient index overflow\n"); + return -1; + } block[perm[i]] = (token >> 9) * dequantizer[perm[i]]; i++; break; |