summaryrefslogtreecommitdiff
path: root/libavcodec/mpegaudiodec_template.c
diff options
context:
space:
mode:
Diffstat (limited to 'libavcodec/mpegaudiodec_template.c')
-rw-r--r--libavcodec/mpegaudiodec_template.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/libavcodec/mpegaudiodec_template.c b/libavcodec/mpegaudiodec_template.c
index be8ce6d56e..f5031925ed 100644
--- a/libavcodec/mpegaudiodec_template.c
+++ b/libavcodec/mpegaudiodec_template.c
@@ -1962,6 +1962,10 @@ static int decode_frame_mp3on4(AVCodecContext *avctx, void *data,
avctx->bit_rate += m->bit_rate;
}
+ if (ch != avctx->channels) {
+ av_log(avctx, AV_LOG_ERROR, "failed to decode all channels\n");
+ return AVERROR_INVALIDDATA;
+ }
/* update codec info */
avctx->sample_rate = s->mp3decctx[0]->sample_rate;