diff options
author | Michael Niedermayer <[email protected]> | 2015-03-09 00:10:43 +0100 |
---|---|---|
committer | Michael Niedermayer <[email protected]> | 2015-03-09 00:10:43 +0100 |
commit | d4afc388e38ea458979bd85fcc213d9da0e02810 (patch) | |
tree | 2d87e77e13da7a1ad5913f0d27e1caa1a0b4a287 | |
parent | 7071b8192d26c51c751ec8f8e0bc809d7377c95f (diff) | |
parent | cf3523c6e7dde33a513e003639d5a8c0b7f3a49d (diff) |
Merge commit 'cf3523c6e7dde33a513e003639d5a8c0b7f3a49d' into release/2.4
* commit 'cf3523c6e7dde33a513e003639d5a8c0b7f3a49d':
prores: Extend the padding check to 16bit
Merged-by: Michael Niedermayer <[email protected]>
-rw-r--r-- | libavcodec/proresdec_lgpl.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/libavcodec/proresdec_lgpl.c b/libavcodec/proresdec_lgpl.c index f2e24ec786..a8bb9234ec 100644 --- a/libavcodec/proresdec_lgpl.c +++ b/libavcodec/proresdec_lgpl.c @@ -366,6 +366,7 @@ static inline void decode_dc_coeffs(GetBitContext *gb, int16_t *out, } } +#define MAX_PADDING 16 /** * Decode AC coefficients for all blocks in a slice. @@ -390,7 +391,7 @@ static inline int decode_ac_coeffs(GetBitContext *gb, int16_t *out, lev_cb_index = ff_prores_lev_to_cb_index[FFMIN(level, 9)]; bits_left = get_bits_left(gb); - if (bits_left <= 0 || (bits_left <= 8 && !show_bits(gb, bits_left))) + if (bits_left <= 0 || (bits_left <= MAX_PADDING && !show_bits(gb, bits_left))) return 0; run = decode_vlc_codeword(gb, ff_prores_ac_codebook[run_cb_index]); @@ -398,7 +399,7 @@ static inline int decode_ac_coeffs(GetBitContext *gb, int16_t *out, return AVERROR_INVALIDDATA; bits_left = get_bits_left(gb); - if (bits_left <= 0 || (bits_left <= 8 && !show_bits(gb, bits_left))) + if (bits_left <= 0 || (bits_left <= MAX_PADDING && !show_bits(gb, bits_left))) return AVERROR_INVALIDDATA; level = decode_vlc_codeword(gb, ff_prores_ac_codebook[lev_cb_index]) + 1; |