From 3a6b42c10ef34a42ba354399b2193e1c248ef11c Mon Sep 17 00:00:00 2001 From: Mathis Rosenhauer Date: Thu, 14 Jan 2016 14:30:42 +0100 Subject: [PATCH] Fail if output buffer cannot be completely filled with selected type. --- src/decode.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/decode.c b/src/decode.c index 3a8b7fe..66be682 100644 --- a/src/decode.c +++ b/src/decode.c @@ -804,6 +804,9 @@ int aec_decode(struct aec_stream *strm, int flush) struct internal_state *state = strm->state; int status; + if (strm->avail_out % strm->state->bytes_per_sample) + return AEC_MEM_ERROR; + strm->total_in += strm->avail_in; strm->total_out += strm->avail_out; -- 2.7.4