diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2014-01-12 16:51:26 +0100 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2014-01-12 16:51:26 +0100 |
commit | f479c178943fdaee5f8d92f88658c57bec3e40b3 (patch) | |
tree | eee37f3280b03504e69abc0cf7c7f9a49129cf3b /libavcodec/shorten.c | |
parent | 1203e92181b4c4af4ba1aa0edc1da3ae8447f9b4 (diff) | |
parent | 65830277d2d2ee3658e1f070a61044fff261ed3e (diff) | |
download | ffmpeg-f479c178943fdaee5f8d92f88658c57bec3e40b3.tar.gz |
Merge commit '65830277d2d2ee3658e1f070a61044fff261ed3e' into release/1.1
* commit '65830277d2d2ee3658e1f070a61044fff261ed3e':
prores: Add a codepath for decoding errors
nut: Fix unchecked allocations
avi: directly resync on DV in AVI read failure
mov: Don't allocate arrays with av_malloc that will be realloced
shorten: Extend fixed_coeffs to properly support pred_order 0
Prepare for 9.11 RELEASE
avi: properly fail if the dv demuxer is missing
prores: Reject negative run and level values
audio_mix: fix channel order in mix_1_to_2_fltp_flt_c
indeo4: Check the inherited quant_mat
Conflicts:
RELEASE
libavcodec/indeo4.c
libavcodec/shorten.c
libavformat/nut.c
libavformat/nutdec.c
libavformat/nutenc.c
Merged-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec/shorten.c')
-rw-r--r-- | libavcodec/shorten.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/libavcodec/shorten.c b/libavcodec/shorten.c index 1ba93b95da..eef322a2a2 100644 --- a/libavcodec/shorten.c +++ b/libavcodec/shorten.c @@ -273,7 +273,8 @@ static int decode_wave_header(AVCodecContext *avctx, const uint8_t *header, return 0; } -static const int fixed_coeffs[3][3] = { +static const int fixed_coeffs[][3] = { + { 0, 0, 0 }, { 1, 0, 0 }, { 2, -1, 0 }, { 3, -3, 1 } @@ -302,7 +303,12 @@ static int decode_subframe_lpc(ShortenContext *s, int command, int channel, } else { /* fixed LPC coeffs */ pred_order = command; - coeffs = fixed_coeffs[pred_order - 1]; + if (pred_order >= FF_ARRAY_ELEMS(fixed_coeffs)) { + av_log(s->avctx, AV_LOG_ERROR, "invalid pred_order %d\n", + pred_order); + return AVERROR_INVALIDDATA; + } + coeffs = fixed_coeffs[pred_order]; qshift = 0; } |