summaryrefslogtreecommitdiff
path: root/libavcodec/mlpdec.c
diff options
context:
space:
mode:
authorAnton Khirnov <anton@khirnov.net>2013-02-14 14:05:35 +0100
committerAnton Khirnov <anton@khirnov.net>2013-02-23 13:05:31 +0100
commit0dff40bfb9a0b24d56ecd64cd90c8f724cc5745f (patch)
tree942208e4cfa83e0e85f410a725c98dd9976a7191 /libavcodec/mlpdec.c
parent56daf10e0313c5e36f43e773f457d2a99ff0df10 (diff)
downloadffmpeg-0dff40bfb9a0b24d56ecd64cd90c8f724cc5745f.tar.gz
mlpdec: do not try to allocate a zero-sized output buffer.
CC:libav-stable@libav.org
Diffstat (limited to 'libavcodec/mlpdec.c')
-rw-r--r--libavcodec/mlpdec.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/libavcodec/mlpdec.c b/libavcodec/mlpdec.c
index cf01b6e23c..130ce26d6c 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) {