[FFmpeg-cvslog] mlpdec: do not try to allocate a zero-sized output buffer.

Anton Khirnov git at videolan.org
Sun Feb 24 13:28:39 CET 2013


ffmpeg | branch: master | Anton Khirnov <anton at khirnov.net> | Thu Feb 14 14:05:35 2013 +0100| [0dff40bfb9a0b24d56ecd64cd90c8f724cc5745f] | committer: Anton Khirnov

mlpdec: do not try to allocate a zero-sized output buffer.

CC:libav-stable at libav.org

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=0dff40bfb9a0b24d56ecd64cd90c8f724cc5745f
---

 libavcodec/mlpdec.c |    5 +++++
 1 file changed, 5 insertions(+)

diff --git a/libavcodec/mlpdec.c b/libavcodec/mlpdec.c
index cf01b6e..130ce26 100644
--- a/libavcodec/mlpdec.c
+++ b/libavcodec/mlpdec.c
@@ -984,6 +984,11 @@ static int output_data(MLPDecodeContext *m, unsigned int substr,
         return AVERROR_INVALIDDATA;
     }
 
+    if (!s->blockpos) {
+        av_log(avctx, AV_LOG_ERROR, "No samples to output.\n");
+        return AVERROR_INVALIDDATA;
+    }
+
     /* get output buffer */
     frame->nb_samples = s->blockpos;
     if ((ret = ff_get_buffer(avctx, frame)) < 0) {



More information about the ffmpeg-cvslog mailing list