diff options
author | Anton Khirnov <anton@khirnov.net> | 2013-02-14 14:05:35 +0100 |
---|---|---|
committer | Reinhard Tartler <siretart@tauware.de> | 2013-02-23 14:40:48 +0100 |
commit | e2cf32ca5f58f7f09dab8730e34aef00c986015f (patch) | |
tree | f896ed4d83a6ccadf97741fa41b7c0857e9b1335 | |
parent | 48fd461977f77f02668111769865e3740908e82a (diff) | |
download | ffmpeg-e2cf32ca5f58f7f09dab8730e34aef00c986015f.tar.gz |
mlpdec: do not try to allocate a zero-sized output buffer.
CC:libav-stable@libav.org
(cherry picked from commit 0dff40bfb9a0b24d56ecd64cd90c8f724cc5745f)
Signed-off-by: Reinhard Tartler <siretart@tauware.de>
-rw-r--r-- | libavcodec/mlpdec.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/libavcodec/mlpdec.c b/libavcodec/mlpdec.c index 80ff4017f7..0eaf2e39e5 100644 --- a/libavcodec/mlpdec.c +++ b/libavcodec/mlpdec.c @@ -978,6 +978,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 */ m->frame.nb_samples = s->blockpos; if ((ret = ff_get_buffer(avctx, &m->frame)) < 0) { |