MpJitterBuffer sometimes outputs from uninitialized memory

12 views
Skip to first unread message

Mihai

unread,
Mar 25, 2015, 5:35:30 AM3/25/15
to si...@googlegroups.com

Hi,

In my tests, the "adjustStream" method happens to be once called with 160 decodedSamples in mDecodedData and with wantedAdjustment of 241, so it will perform an expand. The problem is that the algorithm somehow looks at areas of mDecodedData that don't contain valid data, so it will also operate with uninitialized memory, because mDecodedData is never initialized.

In fact, if I initialize mDecodedData with 0xAB, I can see 0xAB in the output frames, in the middle of valid audio.

The simplest fix seems to be to zero-initialize mDecodedData, like this: memset(mDecodedData, 0, sizeof(mDecodedData));
I'm attaching a patch as well.

Best Regards,
-Mihai
MpJitterBuffer.cpp.patch
Reply all
Reply to author
Forward
0 new messages