Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.xiph.org/xiph/opus.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJean-Marc Valin <jmvalin@jmvalin.ca>2013-11-12 23:20:00 +0400
committerJean-Marc Valin <jmvalin@jmvalin.ca>2013-11-12 23:20:00 +0400
commitdb5b19455f39c521998d521d9d91960ceeebacaa (patch)
tree2c120537d5d15b0e9369189fc932d56dc3ed1dd2
parent1d72d383ac602987882569f362838cd866c5c199 (diff)
Fixes an initialization issue in SILK prefill found by Coverity
-rw-r--r--silk/fixed/encode_frame_FIX.c8
-rw-r--r--silk/float/encode_frame_FLP.c8
2 files changed, 8 insertions, 8 deletions
diff --git a/silk/fixed/encode_frame_FIX.c b/silk/fixed/encode_frame_FIX.c
index 43616369..9c57a10a 100644
--- a/silk/fixed/encode_frame_FIX.c
+++ b/silk/fixed/encode_frame_FIX.c
@@ -302,10 +302,6 @@ opus_int silk_encode_frame_FIX(
silk_memmove( psEnc->x_buf, &psEnc->x_buf[ psEnc->sCmn.frame_length ],
( psEnc->sCmn.ltp_mem_length + LA_SHAPE_MS * psEnc->sCmn.fs_kHz ) * sizeof( opus_int16 ) );
- /* Parameters needed for next frame */
- psEnc->sCmn.prevLag = sEncCtrl.pitchL[ psEnc->sCmn.nb_subfr - 1 ];
- psEnc->sCmn.prevSignalType = psEnc->sCmn.indices.signalType;
-
/* Exit without entropy coding */
if( psEnc->sCmn.prefillFlag ) {
/* No payload */
@@ -314,6 +310,10 @@ opus_int silk_encode_frame_FIX(
return ret;
}
+ /* Parameters needed for next frame */
+ psEnc->sCmn.prevLag = sEncCtrl.pitchL[ psEnc->sCmn.nb_subfr - 1 ];
+ psEnc->sCmn.prevSignalType = psEnc->sCmn.indices.signalType;
+
/****************************************/
/* Finalize payload */
/****************************************/
diff --git a/silk/float/encode_frame_FLP.c b/silk/float/encode_frame_FLP.c
index 29bdc542..df75db91 100644
--- a/silk/float/encode_frame_FLP.c
+++ b/silk/float/encode_frame_FLP.c
@@ -294,10 +294,6 @@ opus_int silk_encode_frame_FLP(
silk_memmove( psEnc->x_buf, &psEnc->x_buf[ psEnc->sCmn.frame_length ],
( psEnc->sCmn.ltp_mem_length + LA_SHAPE_MS * psEnc->sCmn.fs_kHz ) * sizeof( silk_float ) );
- /* Parameters needed for next frame */
- psEnc->sCmn.prevLag = sEncCtrl.pitchL[ psEnc->sCmn.nb_subfr - 1 ];
- psEnc->sCmn.prevSignalType = psEnc->sCmn.indices.signalType;
-
/* Exit without entropy coding */
if( psEnc->sCmn.prefillFlag ) {
/* No payload */
@@ -305,6 +301,10 @@ opus_int silk_encode_frame_FLP(
return ret;
}
+ /* Parameters needed for next frame */
+ psEnc->sCmn.prevLag = sEncCtrl.pitchL[ psEnc->sCmn.nb_subfr - 1 ];
+ psEnc->sCmn.prevSignalType = psEnc->sCmn.indices.signalType;
+
/****************************************/
/* Finalize payload */
/****************************************/