I haven't done any refactoring here.

Resolve coverity warnings.

14305.

The warning is not really valid. The 'decode' function should be called with a 'mode' variable, where inside the function it is assumed that mode is either zero or one. If mode is taking other values some varibles are used uninitialized. However, this is an internal function and it is always called with either ZERO or ONE. Therefore, the code operates correctly. I made small changes as I beleive it is a bit nicer way. 

In ACM:
- Conditions on 'mode' is changed.


Tested with trybots.

BUG=None
TEST=None
Review URL: https://webrtc-codereview.appspot.com/564014

git-svn-id: http://webrtc.googlecode.com/svn/trunk@2297 4adac7df-926f-26a2-2b94-8c16560cd09d
This commit is contained in:
turaj@webrtc.org 2012-05-24 21:20:25 +00:00
parent f45d47ad7d
commit 10d3b5239b

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
@ -59,7 +59,7 @@ void WebRtcIlbcfix_DecodeImpl(
/* Reuse some buffers that are non overlapping in order to save stack memory */
data = &PLCresidual[LPC_FILTERORDER];
if (mode>0) { /* the data are good */
if (mode) { /* the data are good */
/* decode data */
@ -86,7 +86,7 @@ void WebRtcIlbcfix_DecodeImpl(
if (last_bit==1)
mode = 0;
if (mode==1) { /* No bit errors was detected, continue decoding */
if (mode) { /* No bit errors was detected, continue decoding */
/* Stack based */
WebRtc_Word16 lsfdeq[LPC_FILTERORDER*LPC_N_MAX];
WebRtc_Word16 weightdenum[(LPC_FILTERORDER + 1)*NSUB_MAX];