diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2014-01-14 21:00:58 +0100 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2014-01-14 21:00:58 +0100 |
commit | afbe8c6a8441b38a1f3def0e8ae49b626a8c67d2 (patch) | |
tree | 34942e3c9928ec73f60f64b38c5fc305e86c294a /libavcodec/mpegaudiodec_template.c | |
parent | 2545182c294ff6b91ad36a575246788159e39f28 (diff) | |
download | ffmpeg-afbe8c6a8441b38a1f3def0e8ae49b626a8c67d2.tar.gz |
avcodec/mpegaudiodec_template: decode_frame_mp3on4: conceal errors in decoding instead of discarding data
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec/mpegaudiodec_template.c')
-rw-r--r-- | libavcodec/mpegaudiodec_template.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/libavcodec/mpegaudiodec_template.c b/libavcodec/mpegaudiodec_template.c index f5031925ed..1c1ab6e595 100644 --- a/libavcodec/mpegaudiodec_template.c +++ b/libavcodec/mpegaudiodec_template.c @@ -1953,8 +1953,13 @@ static int decode_frame_mp3on4(AVCodecContext *avctx, void *data, if (m->nb_channels > 1) outptr[1] = out_samples[s->coff[fr] + 1]; - if ((ret = mp_decode_frame(m, outptr, buf, fsize)) < 0) - return ret; + if ((ret = mp_decode_frame(m, outptr, buf, fsize)) < 0) { + av_log(avctx, AV_LOG_ERROR, "failed to decode channel %d\n", ch); + memset(outptr[0], 0, MPA_FRAME_SIZE*sizeof(OUT_INT)); + if (m->nb_channels > 1) + memset(outptr[1], 0, MPA_FRAME_SIZE*sizeof(OUT_INT)); + ret = m->nb_channels * MPA_FRAME_SIZE*sizeof(OUT_INT); + } out_size += ret; buf += fsize; |