iSAC: Pad with zeros instead of random data, to make testing easier

Using random "garbage" bytes makes testing harder for no good reason.
Any deterministic sequence would do, but we choose all zeros because
it's simple.

Review URL: https://codereview.webrtc.org/1211243014

Cr-Commit-Position: refs/heads/master@{#9532}
This commit is contained in:
kwiberg 2015-07-02 02:10:07 -07:00 committed by Commit bot
parent 0f133b99c6
commit f4eca64596

View File

@ -715,9 +715,10 @@ int WebRtcIsac_Encode(ISACStruct* ISAC_main_inst,
/* Save data for creation of multiple bit-streams. */
/* If bit-stream too short then add garbage at the end. */
if (garbageLen > 0) {
for (k = 0; k < garbageLen; k++) {
ptrGarbage[k] = (uint8_t)(rand() & 0xFF);
}
/* Overwrite the garbage area to avoid leaking possibly sensitive data
over the network. This also makes the output deterministic. */
memset(ptrGarbage, 0, garbageLen);
/* For a correct length of the upper-band bit-stream together
* with the garbage. Garbage is embeded in upper-band bit-stream.
* That is the only way to preserve backward compatibility. */