From 772d70bcd2f89841236dd0fc996832228f0a52e1 Mon Sep 17 00:00:00 2001 From: "stefan@webrtc.org" Date: Fri, 2 Dec 2011 09:18:49 +0000 Subject: [PATCH] Fix release build error. BUG= TEST= Review URL: http://webrtc-codereview.appspot.com/304005 git-svn-id: http://webrtc.googlecode.com/svn/trunk@1083 4adac7df-926f-26a2-2b94-8c16560cd09d --- src/modules/video_coding/codecs/vp8/main/test/rps_test.cc | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/modules/video_coding/codecs/vp8/main/test/rps_test.cc b/src/modules/video_coding/codecs/vp8/main/test/rps_test.cc index 569e3eea2..8dc39d679 100644 --- a/src/modules/video_coding/codecs/vp8/main/test/rps_test.cc +++ b/src/modules/video_coding/codecs/vp8/main/test/rps_test.cc @@ -134,7 +134,9 @@ void VP8RpsTest::Perform() { bool VP8RpsTest::Encode(RpsDecodeCompleteCallback* decodeCallback) { _lengthEncFrame = 0; - fread(_sourceBuffer, 1, _lengthSourceFrame, _sourceFile); + size_t bytes_read = fread(_sourceBuffer, 1, _lengthSourceFrame, _sourceFile); + if (bytes_read < 0) + return true; _inputVideoBuffer.CopyBuffer(_lengthSourceFrame, _sourceBuffer); _inputVideoBuffer.SetTimeStamp((unsigned int) (_encFrameCnt * 9e4 / _inst.maxFramerate)); @@ -161,6 +163,9 @@ bool VP8RpsTest::Encode(RpsDecodeCompleteCallback* decodeCallback) { } printf("Encoding: %u\n", _framecnt); int ret = _encoder->Encode(rawImage, codecSpecificInfo, &frameType); + if (ret < 0) + printf("Failed to encode: %u\n", _framecnt); + if (codecSpecificInfo != NULL) { delete codecSpecificInfo; codecSpecificInfo = NULL; @@ -172,7 +177,6 @@ bool VP8RpsTest::Encode(RpsDecodeCompleteCallback* decodeCallback) { else { _totalEncodeTime += tGetTime() - _encodeTimes[rawImage._timeStamp]; } - assert(ret >= 0); return false; }