Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(797)

Unified Diff: webrtc/modules/audio_coding/codecs/isac/main/source/isac.c

Issue 1211243014: iSAC: Pad with zeros instead of random data, to make testing easier (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Created 5 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/modules/audio_coding/codecs/isac/main/source/isac.c
diff --git a/webrtc/modules/audio_coding/codecs/isac/main/source/isac.c b/webrtc/modules/audio_coding/codecs/isac/main/source/isac.c
index 6a91757ad47361830c0b6c4490ed57889a47759d..d278c7fd8bc50a21867a62e00da2981e2a0b22ed 100644
--- a/webrtc/modules/audio_coding/codecs/isac/main/source/isac.c
+++ b/webrtc/modules/audio_coding/codecs/isac/main/source/isac.c
@@ -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. */
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698