Fixing Valgrind problem detected by video_processing_unittests.
Simple initialization of the allocated memory for the image buffer avoids reading uninitialized data in some special cases. This fix is only intended for Linux, since the test is known to fail on Windows. But since we're currently only running Valgrind on Linux, this will give us improved control over memory issues. BUG= TEST=tools/valgrind-webrtc/webrtc_tests.sh -t cmdline out/Debug/video_processing_unittests Review URL: http://webrtc-codereview.appspot.com/349012 git-svn-id: http://webrtc.googlecode.com/svn/trunk@1493 4adac7df-926f-26a2-2b94-8c16560cd09d
This commit is contained in:
parent
9dddfaefdc
commit
5e1625ed2d
@ -564,10 +564,14 @@ VideoFrame::VerifyAndAllocate(const WebRtc_UWord32 minimumSize)
|
||||
memcpy(newBufferBuffer, _buffer, _bufferSize);
|
||||
delete [] _buffer;
|
||||
}
|
||||
else
|
||||
{
|
||||
memset(newBufferBuffer, 0, minimumSize * sizeof(WebRtc_UWord8));
|
||||
}
|
||||
_buffer = newBufferBuffer;
|
||||
_bufferSize = minimumSize;
|
||||
}
|
||||
return 0;
|
||||
return 0;
|
||||
}
|
||||
|
||||
inline
|
||||
|
Loading…
x
Reference in New Issue
Block a user