diff options
author | Luca Barbato <lu_zero@gentoo.org> | 2013-06-27 02:50:52 +0200 |
---|---|---|
committer | Luca Barbato <lu_zero@gentoo.org> | 2013-08-24 11:28:11 +0200 |
commit | 64bcb5d35013a4a41969b124a3dcf9a21aef9346 (patch) | |
tree | b96d9c186e31d3f77d6d2e949f38824376c80b3d | |
parent | 998a0389d307109af43e452441050281a09d540c (diff) | |
download | ffmpeg-64bcb5d35013a4a41969b124a3dcf9a21aef9346.tar.gz |
qdm2: check and reset dithering index per channel
Checking per subband would have the index exceed the
dithering noise table size.
Reported-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC: libav-stable@libav.org
(cherry picked from commit 744a11c996641888d477a3981d609e79eeb69ea9)
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
-rw-r--r-- | libavcodec/qdm2.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/libavcodec/qdm2.c b/libavcodec/qdm2.c index 297ca65bc1..697f852c12 100644 --- a/libavcodec/qdm2.c +++ b/libavcodec/qdm2.c @@ -825,8 +825,6 @@ static void synthfilt_build_sb_samples(QDM2Context *q, GetBitContext *gb, } for (sb = sb_min; sb < sb_max; sb++) { - FIX_NOISE_IDX(q->noise_idx); - channels = q->nb_channels; if (q->nb_channels <= 1 || sb < 12) @@ -850,6 +848,7 @@ static void synthfilt_build_sb_samples(QDM2Context *q, GetBitContext *gb, } for (ch = 0; ch < channels; ch++) { + FIX_NOISE_IDX(q->noise_idx); zero_encoding = (get_bits_left(gb) >= 1) ? get_bits1(gb) : 0; type34_predictor = 0.0; type34_first = 1; |