This CL solves three remaining Coverity warnings.

A few more members were left uninitialized, and one more size mismatch in a multiplication.

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

git-svn-id: http://webrtc.googlecode.com/svn/trunk@1558 4adac7df-926f-26a2-2b94-8c16560cd09d
This commit is contained in:
tina.legrand@webrtc.org 2012-01-27 09:00:46 +00:00
parent 4bcd1776a6
commit cbe1de9aa6
3 changed files with 25 additions and 24 deletions

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2011 The WebRTC project authors. All Rights Reserved.
* Copyright (c) 2012 The WebRTC project authors. All Rights Reserved.
*
* Use of this source code is governed by a BSD-style license
* that can be found in the LICENSE file in the root of the source
@ -44,7 +44,10 @@ namespace webrtc {
ACMG729_1::ACMG729_1( WebRtc_Word16 /* codecID */)
: _encoderInstPtr(NULL),
_decoderInstPtr(NULL) {
_decoderInstPtr(NULL),
_myRate(32000),
_flag8kHz(0),
_flagG729mode(0) {
return;
}
@ -163,22 +166,16 @@ ACMG729_1::SetBitRateSafe(
struct G729_1_inst_t_;
ACMG729_1::ACMG729_1(
WebRtc_Word16 codecID):
_encoderInstPtr(NULL),
_decoderInstPtr(NULL)
{
_codecID = codecID;
// Our current G729.1 does not support Annex C
// which is DTX.
_hasInternalDTX = false;
// Default rate
_myRate = 32000;
_flag8kHz = 0;
_flagG729mode = 0;
return;
ACMG729_1::ACMG729_1(WebRtc_Word16 codecID)
: _encoderInstPtr(NULL),
_decoderInstPtr(NULL),
_myRate(32000), // Default rate.
_flag8kHz(0),
_flagG729mode(0) {
// TODO(tlegrand): We should add codecID as a input variable to the
// constructor of ACMGenericCodec.
_codecID = codecID;
return;
}
ACMG729_1::~ACMG729_1()

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2011 The WebRTC project authors. All Rights Reserved.
* Copyright (c) 2012 The WebRTC project authors. All Rights Reserved.
*
* Use of this source code is governed by a BSD-style license
* that can be found in the LICENSE file in the root of the source
@ -54,7 +54,12 @@ namespace webrtc {
#ifndef WEBRTC_CODEC_SPEEX
ACMSPEEX::ACMSPEEX(WebRtc_Word16 /* codecID*/)
: _encoderInstPtr(NULL),
_decoderInstPtr(NULL) {
_decoderInstPtr(NULL),
_complMode(0),
_vbrEnabled(false),
_encodingRate(-1),
_samplingFrequency(-1),
_samplesIn20MsAudio(-1) {
return;
}

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2011 The WebRTC project authors. All Rights Reserved.
* Copyright (c) 2012 The WebRTC project authors. All Rights Reserved.
*
* Use of this source code is governed by a BSD-style license
* that can be found in the LICENSE file in the root of the source
@ -1191,9 +1191,8 @@ match");
} else {
// Copy payload data for future use.
size_t length = static_cast<size_t>(
audioFrame._payloadDataLengthInSamples * audio_channels *
sizeof(WebRtc_UWord16));
memcpy(audio, audioFrame._payloadData, length);
audioFrame._payloadDataLengthInSamples * audio_channels);
memcpy(audio, audioFrame._payloadData, length * sizeof(WebRtc_UWord16));
}
WebRtc_UWord32 currentTimestamp;