On Wed Dec 6 21:42:48 EET 2017, James Almer <jamrial at gmail.com>
> Valgrind apparently complains about this commit, as i mentioned in
> another reply to this thread

Hi James, thanks for reporting the issue. There's indeed a problem
with patch #3 (use-of-uninitialized-memory in norm[] and norm2[]).

libopus organizes the norm[] variable into bands with *room for* 8
MDCT coefficients in each band (even though the actual number of
coefficients per band is 1, 2, 4, or 8 for 2.5ms, 5ms, 10ms, or 20ms
CELT frames, respectively).

Whereas Libav/FFmpeg changes the organization of norm[] slightly and
packs the bands contiguously (i.e. each band is allocated the
necessary amount of 1 << f->size MDCT coefficients, and no more),
leaving some unused space at the end of norm[].

Hence, every instance of "8 * xxx" in my patch should really be
"xxx << f->size". That got rid of all errors in valgrind/MSAN.

Rostislav has applied the change to master with Commit
4678339e745dac8fa428 ("opus: fix hybrid folding indexing during band
quantization"), so the bug should be fixed now. Thanks for catching

ffmpeg-devel mailing list

Reply via email to