[FFmpeg-cvslog] r24097 - trunk/libavcodec/aacdec.c
mru
subversion
Wed Jul 7 22:23:57 CEST 2010
Author: mru
Date: Wed Jul 7 22:23:56 2010
New Revision: 24097
Log:
aacdec: remove checks for impossible error conditions
Modified:
trunk/libavcodec/aacdec.c
Modified: trunk/libavcodec/aacdec.c
==============================================================================
--- trunk/libavcodec/aacdec.c Wed Jul 7 22:09:45 2010 (r24096)
+++ trunk/libavcodec/aacdec.c Wed Jul 7 22:23:56 2010 (r24097)
@@ -995,7 +995,6 @@ static int decode_spectrum_and_dequant(A
const int c = 1024 / ics->num_windows;
const uint16_t *offsets = ics->swb_offset;
float *coef_base = coef;
- int err_idx;
for (g = 0; g < ics->num_windows; g++)
memset(coef + g * 128 + offsets[ics->max_sfb], 0, sizeof(float) * (c - offsets[ics->max_sfb]));
@@ -1031,7 +1030,6 @@ static int decode_spectrum_and_dequant(A
const float *vq = ff_aac_codebook_vector_vals[cbt_m1];
const uint16_t *cb_vector_idx = ff_aac_codebook_vector_idx[cbt_m1];
VLC_TYPE (*vlc_tab)[2] = vlc_spectral[cbt_m1].table;
- const int cb_size = ff_aac_spectral_sizes[cbt_m1];
OPEN_READER(re, gb);
switch (cbt_m1 >> 1) {
@@ -1046,12 +1044,6 @@ static int decode_spectrum_and_dequant(A
UPDATE_CACHE(re, gb);
GET_VLC(code, re, gb, vlc_tab, 8, 2);
-
- if (code >= cb_size) {
- err_idx = code;
- goto err_cb_overflow;
- }
-
cb_idx = cb_vector_idx[code];
cf = VMUL4(cf, vq, cb_idx, sf + idx);
} while (len -= 4);
@@ -1071,12 +1063,6 @@ static int decode_spectrum_and_dequant(A
UPDATE_CACHE(re, gb);
GET_VLC(code, re, gb, vlc_tab, 8, 2);
-
- if (code >= cb_size) {
- err_idx = code;
- goto err_cb_overflow;
- }
-
#if MIN_CACHE_BITS < 20
UPDATE_CACHE(re, gb);
#endif
@@ -1100,12 +1086,6 @@ static int decode_spectrum_and_dequant(A
UPDATE_CACHE(re, gb);
GET_VLC(code, re, gb, vlc_tab, 8, 2);
-
- if (code >= cb_size) {
- err_idx = code;
- goto err_cb_overflow;
- }
-
cb_idx = cb_vector_idx[code];
cf = VMUL2(cf, vq, cb_idx, sf + idx);
} while (len -= 2);
@@ -1126,12 +1106,6 @@ static int decode_spectrum_and_dequant(A
UPDATE_CACHE(re, gb);
GET_VLC(code, re, gb, vlc_tab, 8, 2);
-
- if (code >= cb_size) {
- err_idx = code;
- goto err_cb_overflow;
- }
-
cb_idx = cb_vector_idx[code];
nnz = cb_idx >> 8 & 15;
sign = SHOW_UBITS(re, gb, nnz) << (cb_idx >> 12);
@@ -1163,11 +1137,6 @@ static int decode_spectrum_and_dequant(A
continue;
}
- if (code >= cb_size) {
- err_idx = code;
- goto err_cb_overflow;
- }
-
cb_idx = cb_vector_idx[code];
nnz = cb_idx >> 12;
nzt = cb_idx >> 8;
@@ -1236,12 +1205,6 @@ static int decode_spectrum_and_dequant(A
}
}
return 0;
-
-err_cb_overflow:
- av_log(ac->avctx, AV_LOG_ERROR,
- "Read beyond end of ff_aac_codebook_vectors[%d][]. index %d >= %d\n",
- band_type[idx], err_idx, ff_aac_spectral_sizes[band_type[idx]]);
- return -1;
}
static av_always_inline float flt16_round(float pf)
More information about the ffmpeg-cvslog
mailing list