aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2015-05-14 17:54:40 +0200
committerMichael Niedermayer <michaelni@gmx.at>2015-05-15 10:04:51 +0200
commit10609d88641e565884feaa7a5247cb4f8da49fd1 (patch)
tree8a82fb2e1ec66ddcf2250ed7c72833adfdd4e361
parentdbc48ba1cd8abd005641aae9e8ba0aa311cb1c95 (diff)
downloadffmpeg-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.c5
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++;