From 10d3b5239b286eb0149cf5a8a8f4a2f21f528845 Mon Sep 17 00:00:00 2001 From: "turaj@webrtc.org" Date: Thu, 24 May 2012 21:20:25 +0000 Subject: [PATCH] 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 --- src/modules/audio_coding/codecs/ilbc/decode.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/modules/audio_coding/codecs/ilbc/decode.c b/src/modules/audio_coding/codecs/ilbc/decode.c index 827532c568..c1686913df 100644 --- a/src/modules/audio_coding/codecs/ilbc/decode.c +++ b/src/modules/audio_coding/codecs/ilbc/decode.c @@ -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];