Commit c0de9a23 authored by Luca Barbato's avatar Luca Barbato

prores: Reject negative run and level values

Sample-Id: 00000611-google

Reported-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC: libav-stable@libav.org
parent 054454c6
...@@ -393,12 +393,16 @@ static inline int decode_ac_coeffs(GetBitContext *gb, int16_t *out, ...@@ -393,12 +393,16 @@ static inline int decode_ac_coeffs(GetBitContext *gb, int16_t *out,
return 0; return 0;
run = decode_vlc_codeword(gb, ff_prores_ac_codebook[run_cb_index]); run = decode_vlc_codeword(gb, ff_prores_ac_codebook[run_cb_index]);
if (run < 0)
return AVERROR_INVALIDDATA;
bits_left = get_bits_left(gb); bits_left = get_bits_left(gb);
if (bits_left <= 0 || (bits_left <= 8 && !show_bits(gb, bits_left))) if (bits_left <= 0 || (bits_left <= 8 && !show_bits(gb, bits_left)))
return AVERROR_INVALIDDATA; return AVERROR_INVALIDDATA;
level = decode_vlc_codeword(gb, ff_prores_ac_codebook[lev_cb_index]) + 1; level = decode_vlc_codeword(gb, ff_prores_ac_codebook[lev_cb_index]) + 1;
if (level < 0)
return AVERROR_INVALIDDATA;
pos += run + 1; pos += run + 1;
if (pos >= max_coeffs) if (pos >= max_coeffs)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment