summaryrefslogtreecommitdiff
path: root/libavcodec/mlpdec.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2013-02-24 13:20:25 +0100
committerMichael Niedermayer <michaelni@gmx.at>2013-02-24 13:24:43 +0100
commit9748cac5650a24d5b004a861649ab5a8274d5248 (patch)
tree05ec0391f63699c7a874375f8b029e0d1e3c99e5 /libavcodec/mlpdec.c
parent663ebae79a3e556d8be5004057f805dd82e21062 (diff)
parent4f3b058c84f570e261d743c7c22f865617fd28ac (diff)
Merge commit '4f3b058c84f570e261d743c7c22f865617fd28ac'
* commit '4f3b058c84f570e261d743c7c22f865617fd28ac': cavs: initialize various context tables to 0 mlpdec: do not try to allocate a zero-sized output buffer. Merged-by: Michael Niedermayer <michaelni@gmx.at>
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 8a4eb5f6f8..c763624f1c 100644
--- a/libavcodec/mlpdec.c
+++ b/libavcodec/mlpdec.c
@@ -1016,6 +1016,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) {