aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2015-05-14 17:54:40 +0200
committerMichael Niedermayer <michaelni@gmx.at>2015-05-14 17:56:16 +0200
commit139e1c8009df7729a53eaaae7036ca01071aced5 (patch)
tree1c5abd354a0599aadcade3a79bd298696449d604 /libavcodec
parent729466dc68f9166c13be79581ecc8a79411ee885 (diff)
downloadffmpeg-139e1c8009df7729a53eaaae7036ca01071aced5.tar.gz
avcodec/cavsdec: Check esc_code
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec')
-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++;