Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(741)

Unified Diff: webrtc/modules/audio_coding/codecs/ilbc/encode.c

Issue 2255203002: iLBC: Handle a case of bad input data (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: bool test Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: webrtc/modules/audio_coding/codecs/ilbc/encode.c
diff --git a/webrtc/modules/audio_coding/codecs/ilbc/encode.c b/webrtc/modules/audio_coding/codecs/ilbc/encode.c
index 812ec8d6c7bf025d23b4412cb1b579683a75e90d..82066876e6621d39f834124102fd65eafcec294f 100644
--- a/webrtc/modules/audio_coding/codecs/ilbc/encode.c
+++ b/webrtc/modules/audio_coding/codecs/ilbc/encode.c
@@ -29,6 +29,7 @@
#include "index_conv_enc.h"
#include "pack_bits.h"
#include "hp_input.h"
+#include "webrtc/base/checks.h"
#ifdef SPLIT_10MS
#include "unpack_bits.h"
@@ -206,11 +207,10 @@ void WebRtcIlbcfix_EncodeImpl(
/* construct decoded vector */
- WebRtcIlbcfix_CbConstruct(&decresidual[start_pos+iLBCenc_inst->state_short_len],
- iLBCbits_inst->cb_index, iLBCbits_inst->gain_index,
- mem+CB_MEML-ST_MEM_L_TBL, ST_MEM_L_TBL,
- diff
- );
+ RTC_CHECK(WebRtcIlbcfix_CbConstruct(
+ &decresidual[start_pos + iLBCenc_inst->state_short_len],
+ iLBCbits_inst->cb_index, iLBCbits_inst->gain_index,
+ mem + CB_MEML - ST_MEM_L_TBL, ST_MEM_L_TBL, diff));
}
else { /* put adaptive part in the beginning */
@@ -233,12 +233,10 @@ void WebRtcIlbcfix_EncodeImpl(
0);
/* construct decoded vector */
-
- WebRtcIlbcfix_CbConstruct(reverseDecresidual,
- iLBCbits_inst->cb_index, iLBCbits_inst->gain_index,
- mem+CB_MEML-ST_MEM_L_TBL, ST_MEM_L_TBL,
- diff
- );
+ RTC_CHECK(WebRtcIlbcfix_CbConstruct(
+ reverseDecresidual, iLBCbits_inst->cb_index,
+ iLBCbits_inst->gain_index, mem + CB_MEML - ST_MEM_L_TBL,
+ ST_MEM_L_TBL, diff));
/* get decoded residual from reversed vector */
@@ -344,13 +342,11 @@ void WebRtcIlbcfix_EncodeImpl(
subcount);
/* construct decoded vector */
-
- WebRtcIlbcfix_CbConstruct(&decresidual[(iLBCbits_inst->startIdx+1+subframe)*SUBL],
- iLBCbits_inst->cb_index+subcount*CB_NSTAGES,
- iLBCbits_inst->gain_index+subcount*CB_NSTAGES,
- mem, MEM_LF_TBL,
- SUBL
- );
+ RTC_CHECK(WebRtcIlbcfix_CbConstruct(
+ &decresidual[(iLBCbits_inst->startIdx + 1 + subframe) * SUBL],
+ iLBCbits_inst->cb_index + subcount * CB_NSTAGES,
+ iLBCbits_inst->gain_index + subcount * CB_NSTAGES, mem, MEM_LF_TBL,
+ SUBL));
/* update memory */
@@ -450,12 +446,11 @@ void WebRtcIlbcfix_EncodeImpl(
subcount);
/* construct decoded vector */
-
- WebRtcIlbcfix_CbConstruct(&reverseDecresidual[subframe*SUBL],
- iLBCbits_inst->cb_index+subcount*CB_NSTAGES,
- iLBCbits_inst->gain_index+subcount*CB_NSTAGES,
- mem, MEM_LF_TBL, SUBL
- );
+ RTC_CHECK(WebRtcIlbcfix_CbConstruct(
+ &reverseDecresidual[subframe * SUBL],
+ iLBCbits_inst->cb_index + subcount * CB_NSTAGES,
+ iLBCbits_inst->gain_index + subcount * CB_NSTAGES, mem, MEM_LF_TBL,
+ SUBL));
/* update memory */
memmove(mem, mem + SUBL, (CB_MEML - SUBL) * sizeof(*mem));
« no previous file with comments | « webrtc/modules/audio_coding/codecs/ilbc/decode_residual.c ('k') | webrtc/modules/audio_coding/codecs/ilbc/get_cd_vec.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698