Adding a check to ensure that the memcpy does not exceed bounds of the arrays.
Review URL: http://webrtc-codereview.appspot.com/290007 git-svn-id: http://webrtc.googlecode.com/svn/trunk@1055 4adac7df-926f-26a2-2b94-8c16560cd09d
This commit is contained in:
parent
1e91693fe2
commit
c9801465b6
@ -612,6 +612,14 @@ WebRtc_Word32 AudioDeviceBuffer::GetPlayoutData(WebRtc_Word8* audioBuffer)
|
||||
{
|
||||
CriticalSectionScoped lock(_critSect);
|
||||
|
||||
if (_playSize > kMaxBufferSizeBytes)
|
||||
{
|
||||
WEBRTC_TRACE(kTraceError, kTraceUtility, _id, "_playSize %i exceeds "
|
||||
"kMaxBufferSizeBytes in AudioDeviceBuffer::GetPlayoutData", _playSize);
|
||||
assert(false);
|
||||
return -1;
|
||||
}
|
||||
|
||||
memcpy(audioBuffer, &_playBuffer[0], _playSize);
|
||||
|
||||
if (_playFile.Open())
|
||||
|
Loading…
x
Reference in New Issue
Block a user