aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLuca Barbato <lu_zero@gentoo.org>2013-06-27 02:50:52 +0200
committerLuca Barbato <lu_zero@gentoo.org>2013-09-13 15:39:06 +0200
commit7296ee7af1424ad11afb9ea711f18f2b563c735b (patch)
treef5b05bf20be37c1427ec28f182703dea8d1b0e5a
parent26589aa81028f42c763c5581a1486a271799890b (diff)
downloadffmpeg-7296ee7af1424ad11afb9ea711f18f2b563c735b.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> Conflicts: libavcodec/qdm2.c
-rw-r--r--libavcodec/qdm2.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/libavcodec/qdm2.c b/libavcodec/qdm2.c
index 59bce40c2d..856f9a4c92 100644
--- a/libavcodec/qdm2.c
+++ b/libavcodec/qdm2.c
@@ -784,8 +784,6 @@ static void synthfilt_build_sb_samples (QDM2Context *q, GetBitContext *gb, int l
}
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)
@@ -809,6 +807,7 @@ static void synthfilt_build_sb_samples (QDM2Context *q, GetBitContext *gb, int l
}
for (ch = 0; ch < channels; ch++) {
+ FIX_NOISE_IDX(q->noise_idx);
zero_encoding = (BITS_LEFT(length,gb) >= 1) ? get_bits1(gb) : 0;
type34_predictor = 0.0;
type34_first = 1;