diff --git a/decoder/ixheaacd_pns_js_thumb.c b/decoder/ixheaacd_pns_js_thumb.c index 15db806..534ec5b 100644 --- a/decoder/ixheaacd_pns_js_thumb.c +++ b/decoder/ixheaacd_pns_js_thumb.c @@ -354,11 +354,12 @@ VOID ixheaacd_aac_tns_process( scale_spec = (*ixheaacd_calc_max_spectral_line)(ptr_tmp, size); } - if (filter->direction != -1) { - position = start; - } else { + if (filter->direction == -1) { position = stop - 1; if (((win << 7) + position) < filter->order) continue; + } else { + position = start; + if ((((win << 7) + position) + filter->order) > MAX_BINS_LONG) continue; } if ((num_ch <= 2) &&