Address Clag Analyzer issues.

Following are the issues related to NetEq 4, discovered by Clang Analyzer.

https://x20web.corp.google.com/~pbos/scan-build-2013-10-10-1/report-b44b95.html#EndPath
Valid; perhaps unlikely, addressed.

https://x20web.corp.google.com/~pbos/scan-build-2013-10-10-1/report-6beef6.html#EndPath
Valid, addressed.

https://x20web.corp.google.com/~pbos/scan-build-2013-10-10-1/report-2e3883.html#EndPath
Valid; Addressed

https://x20web.corp.google.com/~pbos/scan-build-2013-10-10-1/report-293659.html#EndPath
Valid; Addressed.

https://x20web.corp.google.com/~pbos/scan-build-2013-10-10-1/report-b875cd.html#EndPath
Valid; Addressed.

https://x20web.corp.google.com/~pbos/scan-build-2013-10-10-1/index.html
Not valid;

https://x20web.corp.google.com/~pbos/scan-build-2013-10-10-1/report-86f2ed.html#EndPath
Not Valid; the assert statement will be short-circuited, however I also added a check of nullity of |packet|.

https://x20web.corp.google.com/~pbos/scan-build-2013-10-10-1/report-3a5669.html#EndPath
Not Valid: |energy_input| and |energy_expand| are both non-negative, therefore if-statement condition on line 226 is not satisfied unless |energy_input| >= 1. Therefore |energy_input| cannot be zero after normalization to 14-bits, i.e. operations on lines 228 & 229.

https://x20web.corp.google.com/~pbos/scan-build-2013-10-10-1/report-2f914f.html#EndPath
Valid; addressed.

https://x20web.corp.google.com/~pbos/scan-build-2013-10-10-1/report-2332b1.html#EndPath
Valid; addressed.

https://x20web.corp.google.com/~pbos/scan-build-2013-10-10-1/report-de8dea.html#EndPath
Not valid; |out_len| is set when Process() is called, however, it makes sense to initialize to zero when declaring |out_len|.

https://x20web.corp.google.com/~pbos/scan-build-2013-10-10-1/report-b671a3.html#EndPath
Valid; addressed.

BUG=
R=henrik.lundin@webrtc.org

Review URL: https://webrtc-codereview.appspot.com/2729005

git-svn-id: http://webrtc.googlecode.com/svn/trunk@5064 4adac7df-926f-26a2-2b94-8c16560cd09d
This commit is contained in:
turaj@webrtc.org
2013-10-31 15:15:55 +00:00
parent 7d6bd22019
commit 58cd31665c
6 changed files with 31 additions and 15 deletions

View File

@@ -330,7 +330,7 @@ void NetEqDecodingTest::DecodeAndCompare(const std::string &rtp_file,
std::ostringstream ss;
ss << "Lap number " << i++ << " in DecodeAndCompare while loop";
SCOPED_TRACE(ss.str()); // Print out the parameter values on failure.
int out_len;
int out_len = 0;
ASSERT_NO_FATAL_FAILURE(Process(&rtp, &out_len));
ASSERT_NO_FATAL_FAILURE(ref_files.ProcessReference(out_data_, out_len));
}
@@ -583,7 +583,6 @@ TEST_F(NetEqDecodingTest, DISABLED_ON_ANDROID(TestFrameWaitingTimeStatistics)) {
std::vector<int> waiting_times;
neteq_->WaitingTimes(&waiting_times);
int len = waiting_times.size();
EXPECT_EQ(num_frames, waiting_times.size());
// Since all frames are dumped into NetEQ at once, but pulled out with 10 ms
// spacing (per definition), we expect the delay to increase with 10 ms for
@@ -594,7 +593,7 @@ TEST_F(NetEqDecodingTest, DISABLED_ON_ANDROID(TestFrameWaitingTimeStatistics)) {
// Check statistics again and make sure it's been reset.
neteq_->WaitingTimes(&waiting_times);
len = waiting_times.size();
int len = waiting_times.size();
EXPECT_EQ(0, len);
// Process > 100 frames, and make sure that that we get statistics