Fix a bug in ACM test channel
The test code could read outside the allocated memory. The bug could up
until now not be triggered by the production code, but coming changes
would uncover it.
COAUTHOR=kwiberg@webrtc.org
R=minyue@webrtc.org
Review URL: https://webrtc-codereview.appspot.com/34929004
Cr-Commit-Position: refs/heads/master@{#8216}
git-svn-id: http://webrtc.googlecode.com/svn/trunk@8216 4adac7df-926f-26a2-2b94-8c16560cd09d
diff --git a/webrtc/modules/audio_coding/main/test/Channel.cc b/webrtc/modules/audio_coding/main/test/Channel.cc
index aa9e6cd..919208a 100644
--- a/webrtc/modules/audio_coding/main/test/Channel.cc
+++ b/webrtc/modules/audio_coding/main/test/Channel.cc
@@ -51,8 +51,8 @@
// Treat fragmentation separately
if (fragmentation != NULL) {
// If silence for too long, send only new data.
- if ((fragmentation->fragmentationTimeDiff[1] <= 0x3fff) &&
- (fragmentation->fragmentationVectorSize == 2)) {
+ if ((fragmentation->fragmentationVectorSize == 2) &&
+ (fragmentation->fragmentationTimeDiff[1] <= 0x3fff)) {
// only 0x80 if we have multiple blocks
_payloadData[0] = 0x80 + fragmentation->fragmentationPlType[1];
size_t REDheader = (fragmentation->fragmentationTimeDiff[1] << 10) +