iSAC float decoder: Don't read past end of initialized part of buffer
We read past the end of the initialized part of the buffer, seemingly on purpose (no one knows the details of this code anymore). The right thing to do is probably to zero that part of the buffer. (The *right* right thing to would be to rewrite this so that it was easier to see what data was supposed to be where when, but priorities...) BUG=chromium:683040 Review-Url: https://codereview.webrtc.org/2659383002 Cr-Commit-Position: refs/heads/master@{#16365}
This commit is contained in:
@ -16,6 +16,8 @@
|
||||
|
||||
#include "os_specific_inline.h"
|
||||
|
||||
#include "webrtc/system_wrappers/include/compile_assert_c.h"
|
||||
|
||||
/*
|
||||
* We are implementing the following filters;
|
||||
*
|
||||
@ -275,6 +277,11 @@ static void FilterFrame(const double* in_data, PitchFiltstr* filter_state,
|
||||
/* Copy states to local variables. */
|
||||
memcpy(filter_parameters.buffer, filter_state->ubuf,
|
||||
sizeof(filter_state->ubuf));
|
||||
COMPILE_ASSERT(sizeof(filter_parameters.buffer) >=
|
||||
sizeof(filter_state->ubuf));
|
||||
memset(filter_parameters.buffer +
|
||||
sizeof(filter_state->ubuf) / sizeof(filter_state->ubuf[0]),
|
||||
0, sizeof(filter_parameters.buffer) - sizeof(filter_state->ubuf));
|
||||
memcpy(filter_parameters.damper_state, filter_state->ystate,
|
||||
sizeof(filter_state->ystate));
|
||||
|
||||
|
||||
Reference in New Issue
Block a user