From 05db352f56b369444e1a83c5c85a4fb513bf60f0 Mon Sep 17 00:00:00 2001 From: "henrik.lundin@webrtc.org" Date: Fri, 30 Jan 2015 13:03:45 +0000 Subject: [PATCH] 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 --- webrtc/modules/audio_coding/main/test/Channel.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/webrtc/modules/audio_coding/main/test/Channel.cc b/webrtc/modules/audio_coding/main/test/Channel.cc index aa9e6cdf4..919208a76 100644 --- a/webrtc/modules/audio_coding/main/test/Channel.cc +++ b/webrtc/modules/audio_coding/main/test/Channel.cc @@ -51,8 +51,8 @@ int32_t Channel::SendData(FrameType frameType, // 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) +