summaryrefslogtreecommitdiff
path: root/libavcodec/wmaprodec.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2013-06-29 12:03:59 +0200
committerMichael Niedermayer <michaelni@gmx.at>2013-06-29 12:23:56 +0200
commita3e9f4c32a92f317ccbf038036f8aa12d2467428 (patch)
treef8e6eeea30634ca4468bc28fa314838510f12f0c /libavcodec/wmaprodec.c
parent562e8d019ba2205a31cf78808e9c4d633bd158be (diff)
parent38229362529ed1619d8ebcc81ecde85b23b45895 (diff)
Merge remote-tracking branch 'qatar/master'
* qatar/master: wmapro: check num_vec_coeffs against the actual available buffer Conflicts: libavcodec/wmaprodec.c The check is replaced by an assert. See: b21ba20cc83c80fe56192fee3626a8087f37d806 Merged-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec/wmaprodec.c')
-rw-r--r--libavcodec/wmaprodec.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/libavcodec/wmaprodec.c b/libavcodec/wmaprodec.c
index ce1f851c1b..de05a8b300 100644
--- a/libavcodec/wmaprodec.c
+++ b/libavcodec/wmaprodec.c
@@ -1129,11 +1129,12 @@ static int decode_subframe(WMAProDecodeCtx *s)
cur_subwoofer_cutoff = s->subwoofer_cutoffs[s->table_idx];
/** configure the decoder for the current subframe */
+ offset += s->samples_per_frame >> 1;
+
for (i = 0; i < s->channels_for_cur_subframe; i++) {
int c = s->channel_indexes_for_cur_subframe[i];
- s->channel[c].coeffs = &s->channel[c].out[(s->samples_per_frame >> 1)
- + offset];
+ s->channel[c].coeffs = &s->channel[c].out[offset];
}
s->subframe_len = subframe_len;
@@ -1189,6 +1190,7 @@ static int decode_subframe(WMAProDecodeCtx *s)
av_log(s->avctx, AV_LOG_ERROR, "num_vec_coeffs %d is too large\n", num_vec_coeffs);
return AVERROR_INVALIDDATA;
}
+ av_assert0(num_vec_coeffs + offset <= FF_ARRAY_ELEMS(s->channel[c].out));
s->channel[c].num_vec_coeffs = num_vec_coeffs;
}
} else {