[FFmpeg-cvslog] mpegaudiodec: Do not discard mp_decode_frame() return value.
Diego Biurrun
git at videolan.org
Wed Apr 18 22:28:26 CEST 2012
ffmpeg | branch: master | Diego Biurrun <diego at biurrun.de> | Thu Apr 5 16:48:33 2012 +0200| [aa3f2cb58462aed387625189e3dabf91b9fbd3e6] | committer: Diego Biurrun
mpegaudiodec: Do not discard mp_decode_frame() return value.
This fixes the warning:
libavcodec/mpegaudiodec.c:1704:14: warning: variable ‘out_size’ set but not used
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=aa3f2cb58462aed387625189e3dabf91b9fbd3e6
---
libavcodec/mpegaudiodec.c | 4 ++++
1 files changed, 4 insertions(+), 0 deletions(-)
diff --git a/libavcodec/mpegaudiodec.c b/libavcodec/mpegaudiodec.c
index 0ab87e1..f72e65c 100644
--- a/libavcodec/mpegaudiodec.c
+++ b/libavcodec/mpegaudiodec.c
@@ -1733,6 +1733,10 @@ static int decode_frame_adu(AVCodecContext *avctx, void *data,
s->frame_size = len;
out_size = mp_decode_frame(s, NULL, buf, buf_size);
+ if (out_size < 0) {
+ av_log(avctx, AV_LOG_ERROR, "Error while decoding MPEG audio frame.\n");
+ return AVERROR_INVALIDDATA;
+ }
*got_frame_ptr = 1;
*(AVFrame *)data = s->frame;
More information about the ffmpeg-cvslog
mailing list