diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2015-03-02 20:00:43 +0100 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2015-03-02 20:01:28 +0100 |
commit | ada512f91df6b1ed2fc15bd1b497a09de120ec49 (patch) | |
tree | 53ba4b73d856ee7aa7f240cf6bb66c020c606398 | |
parent | efd3f407e50ec04eb9b90825bf8436f221e65de8 (diff) | |
parent | dbc1163b203b175d246b7454c32ac176f84006d1 (diff) | |
download | ffmpeg-ada512f91df6b1ed2fc15bd1b497a09de120ec49.tar.gz |
Merge commit 'dbc1163b203b175d246b7454c32ac176f84006d1'
* commit 'dbc1163b203b175d246b7454c32ac176f84006d1':
prores: Extend the padding check to 16bit
Merged-by: Michael Niedermayer <michaelni@gmx.at>
-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 a680bd6455..4bdf392461 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; |