Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/FFmpeg/FFmpeg.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2015-03-02 22:00:43 +0300
committerMichael Niedermayer <michaelni@gmx.at>2015-03-02 22:01:28 +0300
commitada512f91df6b1ed2fc15bd1b497a09de120ec49 (patch)
tree53ba4b73d856ee7aa7f240cf6bb66c020c606398 /libavcodec/proresdec_lgpl.c
parentefd3f407e50ec04eb9b90825bf8436f221e65de8 (diff)
parentdbc1163b203b175d246b7454c32ac176f84006d1 (diff)
Merge commit 'dbc1163b203b175d246b7454c32ac176f84006d1'
* commit 'dbc1163b203b175d246b7454c32ac176f84006d1': prores: Extend the padding check to 16bit Merged-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec/proresdec_lgpl.c')
-rw-r--r--libavcodec/proresdec_lgpl.c5
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;