From f4da0776b469f1fa6b2a753cb1824a91f05fb757 Mon Sep 17 00:00:00 2001 From: Martin Storsjo Date: Fri, 29 Jun 2018 15:00:15 +0300 Subject: [PATCH] Fix the aacDecoder_DecodeFrame call in m4a-dec.c On errors, this function clears the output buffer, and the buffer size provided is in number of samples, not number of bytes. --- m4a-dec.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/m4a-dec.c b/m4a-dec.c index 8ad7b97..a825758 100644 --- a/m4a-dec.c +++ b/m4a-dec.c @@ -99,7 +99,7 @@ int main(int argc, char *argv[]) { fprintf(stderr, "Fill failed: %x\n", err); break; } - err = aacDecoder_DecodeFrame(handle, decode_buf, output_size, 0); + err = aacDecoder_DecodeFrame(handle, decode_buf, output_size / sizeof(INT_PCM), 0); av_free_packet(&pkt); if (err == AAC_DEC_NOT_ENOUGH_BITS) continue;