Fail if output buffer cannot be completely filled with selected type.
authorMathis Rosenhauer <rosenhauer@dkrz.de>
Thu, 14 Jan 2016 13:30:42 +0000 (14:30 +0100)
committerMathis Rosenhauer <rosenhauer@dkrz.de>
Thu, 14 Jan 2016 13:30:42 +0000 (14:30 +0100)
src/decode.c

index 3a8b7fe..66be682 100644 (file)
@@ -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;