aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2013-11-24 05:05:09 +0100
committerMichael Niedermayer <michaelni@gmx.at>2013-11-24 05:05:09 +0100
commitceaaf0d97e7fc11b850325201cf30d7b83e80fd2 (patch)
tree3a292ada4a203edbd584d3e2b0dcad5fa45fac35 /libavcodec
parentc0237d19a0269ff44e909434f1b2b645fad2d281 (diff)
parent48b24bd2d208ce0f124029ac4c5ac5cb1fca4175 (diff)
downloadffmpeg-ceaaf0d97e7fc11b850325201cf30d7b83e80fd2.tar.gz
Merge commit '48b24bd2d208ce0f124029ac4c5ac5cb1fca4175'
* commit '48b24bd2d208ce0f124029ac4c5ac5cb1fca4175': ac3dec: Fix out-of-array read Conflicts: libavcodec/ac3dec.c See: 2cbf27b08a4991de608b305a8600b59467587605 Merged-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec')
-rw-r--r--libavcodec/ac3dec.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/libavcodec/ac3dec.c b/libavcodec/ac3dec.c
index 44b5f444c8..82345cd49d 100644
--- a/libavcodec/ac3dec.c
+++ b/libavcodec/ac3dec.c
@@ -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;