aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec/alsdec.c
diff options
context:
space:
mode:
authorThilo Borgmann <thilo.borgmann@googlemail.com>2012-10-13 22:58:55 +0200
committerMichael Niedermayer <michaelni@gmx.at>2012-10-14 00:18:46 +0200
commitfeaff427c0df015146f660199453bd8c0314e677 (patch)
tree44ef9a2905dc71531d0ccc3fd33070d5d0d1c0d0 /libavcodec/alsdec.c
parent20ec0d2a750a804f50c090cf6e6509db8ff9cadd (diff)
downloadandroid_external_ffmpeg-feaff427c0df015146f660199453bd8c0314e677.tar.gz
android_external_ffmpeg-feaff427c0df015146f660199453bd8c0314e677.tar.bz2
android_external_ffmpeg-feaff427c0df015146f660199453bd8c0314e677.zip
alsdec: fix clipping of weightings for MCC decoding
Fixes CID717905 Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec/alsdec.c')
-rw-r--r--libavcodec/alsdec.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/libavcodec/alsdec.c b/libavcodec/alsdec.c
index 60dd8161e8..69e66d6f7f 100644
--- a/libavcodec/alsdec.c
+++ b/libavcodec/alsdec.c
@@ -1175,14 +1175,14 @@ static int read_channel_data(ALSDecContext *ctx, ALSChannelData *cd, int c)
if (current->master_channel != c) {
current->time_diff_flag = get_bits1(gb);
- current->weighting[0] = mcc_weightings[av_clip(decode_rice(gb, 1) + 16, 0, 32)];
- current->weighting[1] = mcc_weightings[av_clip(decode_rice(gb, 2) + 14, 0, 32)];
- current->weighting[2] = mcc_weightings[av_clip(decode_rice(gb, 1) + 16, 0, 32)];
+ current->weighting[0] = mcc_weightings[av_clip(decode_rice(gb, 1) + 16, 0, 31)];
+ current->weighting[1] = mcc_weightings[av_clip(decode_rice(gb, 2) + 14, 0, 31)];
+ current->weighting[2] = mcc_weightings[av_clip(decode_rice(gb, 1) + 16, 0, 31)];
if (current->time_diff_flag) {
- current->weighting[3] = mcc_weightings[av_clip(decode_rice(gb, 1) + 16, 0, 32)];
- current->weighting[4] = mcc_weightings[av_clip(decode_rice(gb, 1) + 16, 0, 32)];
- current->weighting[5] = mcc_weightings[av_clip(decode_rice(gb, 1) + 16, 0, 32)];
+ current->weighting[3] = mcc_weightings[av_clip(decode_rice(gb, 1) + 16, 0, 31)];
+ current->weighting[4] = mcc_weightings[av_clip(decode_rice(gb, 1) + 16, 0, 31)];
+ current->weighting[5] = mcc_weightings[av_clip(decode_rice(gb, 1) + 16, 0, 31)];
current->time_diff_sign = get_bits1(gb);
current->time_diff_index = get_bits(gb, ctx->ltp_lag_length - 3) + 3;