Skip to content
Snippets Groups Projects
Commit ceaaf0d9 authored by Michael Niedermayer's avatar Michael Niedermayer
Browse files

Merge commit '48b24bd2'


* commit '48b24bd2':
  ac3dec: Fix out-of-array read

Conflicts:
	libavcodec/ac3dec.c

See: 2cbf27b0
Merged-by: default avatarMichael Niedermayer <michaelni@gmx.at>
parents c0237d19 48b24bd2
No related branches found
No related tags found
No related merge requests found
......@@ -1367,10 +1367,6 @@ static int ac3_decode_frame(AVCodecContext * avctx, void *data,
s->out_channels = 2;
s->output_mode = AC3_CHMODE_STEREO;
}
avctx->channels = s->out_channels;
avctx->channel_layout = avpriv_ac3_channel_layout_tab[s->output_mode & ~AC3_OUTPUT_LFEON];
if (s->output_mode & AC3_OUTPUT_LFEON)
avctx->channel_layout |= AV_CH_LOW_FREQUENCY;
s->loro_center_mix_level = gain_levels[s-> center_mix_level];
s->loro_surround_mix_level = gain_levels[s->surround_mix_level];
......@@ -1386,6 +1382,9 @@ static int ac3_decode_frame(AVCodecContext * avctx, void *data,
return AVERROR_INVALIDDATA;
}
avctx->channels = s->out_channels;
avctx->channel_layout = avpriv_ac3_channel_layout_tab[s->output_mode & ~AC3_OUTPUT_LFEON];
if (s->output_mode & AC3_OUTPUT_LFEON)
avctx->channel_layout |= AV_CH_LOW_FREQUENCY;
/* set audio service type based on bitstream mode for AC-3 */
avctx->audio_service_type = s->bitstream_mode;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment