History

avcodec/aac/aacdec: Move channel number check out of init_dsp()

Also move initializing random_state.

Andreas Rheinhardt committed 2 years ago

Commit ef168821 parent e4e91441 file · +7 −7Browse files

Showing the changes to libavcodec (1 of 1 file). Show all

Unified · Split

libavcodec/aac/aacdec.c+7−7
@@ -1152,13 +1152,6 @@ static av_cold int init_dsp(AVCodecContext *avctx) · 1151 unmodified lines
11521152 const float *const scalep = is_fixed ? &scale_fixed : &scale_float;
11531153 enum AVTXType tx_type = is_fixed ? AV_TX_INT32_MDCT : AV_TX_FLOAT_MDCT;
11541154
1155− if (avctx->ch_layout.nb_channels > MAX_CHANNELS) {
1156− av_log(avctx, AV_LOG_ERROR, "Too many channels\n");
1157− return AVERROR_INVALIDDATA;
1158− }
1159−
1160− ac->random_state = 0x1f2e3d4c;
1161−
11621155 #define MDCT_INIT(s, fn, len, sval) \
11631156 scale_fixed = (sval) * 128.0f; \
11641157 scale_float = (sval) / 32768.0f; \
@@ -1241,6 +1234,13 @@ static av_cold int aac_decode_init_internal(AVCodecContext *avctx) · 76 unmodified lines
12411234 }
12421235 }
12431236
1237+ if (avctx->ch_layout.nb_channels > MAX_CHANNELS) {
1238+ av_log(avctx, AV_LOG_ERROR, "Too many channels\n");
1239+ return AVERROR_INVALIDDATA;
1240+ }
1241+
1242+ ac->random_state = 0x1f2e3d4c;
1243+
12441244 return init_dsp(avctx);
12451245 }
12461246

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t