summaryrefslogtreecommitdiff
path: root/libavcodec/proresdec.c
diff options
context:
space:
mode:
authorLuca Barbato <lu_zero@gentoo.org>2013-10-10 21:02:10 +0200
committerLuca Barbato <lu_zero@gentoo.org>2013-10-10 21:02:10 +0200
commitc0de9a23c7080e2fac8f879b9d9a0ce2b64ea953 (patch)
treec10fa33eb37ae01d273b6669894d19e2c2432bfa /libavcodec/proresdec.c
parent054454c63a2e07354c4bca8019a2f1e8060ffca8 (diff)
prores: Reject negative run and level values
Sample-Id: 00000611-google Reported-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind CC: libav-stable@libav.org
Diffstat (limited to 'libavcodec/proresdec.c')
-rw-r--r--libavcodec/proresdec.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/libavcodec/proresdec.c b/libavcodec/proresdec.c
index c65d7298f2..144fa26f8c 100644
--- a/libavcodec/proresdec.c
+++ b/libavcodec/proresdec.c
@@ -393,12 +393,16 @@ static inline int decode_ac_coeffs(GetBitContext *gb, int16_t *out,
return 0;
run = decode_vlc_codeword(gb, ff_prores_ac_codebook[run_cb_index]);
+ if (run < 0)
+ return AVERROR_INVALIDDATA;
bits_left = get_bits_left(gb);
if (bits_left <= 0 || (bits_left <= 8 && !show_bits(gb, bits_left)))
return AVERROR_INVALIDDATA;
level = decode_vlc_codeword(gb, ff_prores_ac_codebook[lev_cb_index]) + 1;
+ if (level < 0)
+ return AVERROR_INVALIDDATA;
pos += run + 1;
if (pos >= max_coeffs)