diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2015-05-14 17:54:40 +0200 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2015-05-15 10:04:51 +0200 |
commit | 10609d88641e565884feaa7a5247cb4f8da49fd1 (patch) | |
tree | 8a82fb2e1ec66ddcf2250ed7c72833adfdd4e361 | |
parent | dbc48ba1cd8abd005641aae9e8ba0aa311cb1c95 (diff) | |
download | ffmpeg-10609d88641e565884feaa7a5247cb4f8da49fd1.tar.gz |
avcodec/cavsdec: Check esc_code
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 139e1c8009df7729a53eaaae7036ca01071aced5)
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
-rw-r--r-- | libavcodec/cavsdec.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/libavcodec/cavsdec.c b/libavcodec/cavsdec.c index cffb19c959..834092f0dd 100644 --- a/libavcodec/cavsdec.c +++ b/libavcodec/cavsdec.c @@ -563,6 +563,11 @@ static int decode_residual_block(AVSContext *h, GetBitContext *gb, return AVERROR_INVALIDDATA; } esc_code = get_ue_code(gb, esc_golomb_order); + if (esc_code < 0 || esc_code > 32767) { + av_log(h->avctx, AV_LOG_ERROR, "esc_code invalid\n"); + return AVERROR_INVALIDDATA; + } + level = esc_code + (run > r->max_run ? 1 : r->level_add[run]); while (level > r->inc_limit) r++; |