diff options
Diffstat (limited to 'libavcodec/aacenc_tns.c')
-rw-r--r-- | libavcodec/aacenc_tns.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/libavcodec/aacenc_tns.c b/libavcodec/aacenc_tns.c index 0b22b6755e..a7433a8d19 100644 --- a/libavcodec/aacenc_tns.c +++ b/libavcodec/aacenc_tns.c @@ -97,6 +97,10 @@ static void process_tns_coeffs(TemporalNoiseShaping *tns, double *coef_raw, break; } } + order = av_clip(order, 0, TNS_MAX_ORDER - 1); + *order_p = order; + if (!order) + return; /* Step up procedure, convert to LPC coeffs */ out[0] = 1.0f; @@ -109,7 +113,6 @@ static void process_tns_coeffs(TemporalNoiseShaping *tns, double *coef_raw, } out[i] = lpc[i-1]; } - *order_p = order; memcpy(lpc, out, TNS_MAX_ORDER*sizeof(float)); } |