diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2013-10-11 16:48:10 +0200 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2013-10-11 16:48:26 +0200 |
commit | e7fa0417b31a671f5c7bb27f7f30f9acfcf4cfab (patch) | |
tree | eb88834a09316da791e9b07dd06c544b3d89f972 | |
parent | f02bab6d09781a7d1557e18f98ed08ea7af2aca7 (diff) | |
parent | c0de9a23c7080e2fac8f879b9d9a0ce2b64ea953 (diff) | |
download | ffmpeg-e7fa0417b31a671f5c7bb27f7f30f9acfcf4cfab.tar.gz |
Merge remote-tracking branch 'qatar/master'
* qatar/master:
prores: Reject negative run and level values
See: 93c220e895a417e88a6be7df85e250c5c3f675b6
Merged-by: Michael Niedermayer <michaelni@gmx.at>
-rw-r--r-- | libavcodec/proresdec_lgpl.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/libavcodec/proresdec_lgpl.c b/libavcodec/proresdec_lgpl.c index 627f98fa1c..a57429d70f 100644 --- a/libavcodec/proresdec_lgpl.c +++ b/libavcodec/proresdec_lgpl.c @@ -394,12 +394,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) |