diff options
author | Michael Niedermayer <michael@niedermayer.cc> | 2017-05-25 03:21:50 +0200 |
---|---|---|
committer | Martin Storsjö <martin@martin.st> | 2017-06-13 22:08:44 +0300 |
commit | f61265571d68c410f5307c240a7f9c95c247fb54 (patch) | |
tree | 1dd48b21d6d8782ccc64210bc1fc491bf152b306 | |
parent | 04f691cd4fb7d226e54df886a21ba201cb5019f4 (diff) | |
download | ffmpeg-f61265571d68c410f5307c240a7f9c95c247fb54.tar.gz |
libfdk-aacdec: Correct buffer_size parameter
The timeDataSize argument to aacDecoder_DecodeFrame() seems undocumented
and until 2016 04 (203e3f28fbebec7011342017fafc2a0bda0ce530) unused.
After that commit libfdk-aacdec interprets it as size in sample units
and memsets that on error.
FFmpeg as well as others (like GStreamer) did interpret it as size in
bytes.
Fixes: 1442/clusterfuzz-testcase-minimized-4540199973421056 (This requires recent libfdk to reproduce)
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Martin Storsjö <martin@martin.st>
-rw-r--r-- | libavcodec/libfdk-aacdec.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/libavcodec/libfdk-aacdec.c b/libavcodec/libfdk-aacdec.c index 637d1352a0..aa30f93ef6 100644 --- a/libavcodec/libfdk-aacdec.c +++ b/libavcodec/libfdk-aacdec.c @@ -328,7 +328,7 @@ static int fdk_aac_decode_frame(AVCodecContext *avctx, void *data, return AVERROR_INVALIDDATA; } - err = aacDecoder_DecodeFrame(s->handle, (INT_PCM *) s->decoder_buffer, s->decoder_buffer_size, 0); + err = aacDecoder_DecodeFrame(s->handle, (INT_PCM *) s->decoder_buffer, s->decoder_buffer_size / sizeof(INT_PCM), 0); if (err == AAC_DEC_NOT_ENOUGH_BITS) { ret = avpkt->size - valid; goto end; |