summaryrefslogtreecommitdiff
path: root/libavcodec
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2013-10-09 11:04:06 +0200
committerMichael Niedermayer <michaelni@gmx.at>2013-10-09 11:04:06 +0200
commit7f22df3a49459dc61cd63f4a7329c38bc842f4f3 (patch)
tree60f627276d96954bea46abd9a17a9fc6f4a2748a /libavcodec
parent3aabfaa37b245f86036ea11d82c7c28e5bebde6a (diff)
parentb2148faca9e9e553c14b27844b56e367c85a777e (diff)
Merge remote-tracking branch 'qatar/master'
* qatar/master: shorten: Extend fixed_coeffs to properly support pred_order 0 Conflicts: libavcodec/shorten.c Merged-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec')
-rw-r--r--libavcodec/shorten.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/libavcodec/shorten.c b/libavcodec/shorten.c
index 920cb7d1e9..082019b802 100644
--- a/libavcodec/shorten.c
+++ b/libavcodec/shorten.c
@@ -269,7 +269,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 }
@@ -298,7 +299,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;
}