From e7f36eed224b9530cf0eb7e56d6c43d3de14429e Mon Sep 17 00:00:00 2001 From: Martin Storsjo Date: Sat, 10 Jun 2017 13:58:13 +0300 Subject: Check that the SBR decoder has been properly initialized This probably doesn't fix the root cause, but at least fixes the issues found in this particular fuzzed sample. Fixes: 1994/clusterfuzz-testcase-minimized-6368089497141248 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg --- libSBRdec/src/sbr_dec.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/libSBRdec/src/sbr_dec.cpp b/libSBRdec/src/sbr_dec.cpp index 0864348..76009ba 100644 --- a/libSBRdec/src/sbr_dec.cpp +++ b/libSBRdec/src/sbr_dec.cpp @@ -940,6 +940,10 @@ resetSbrDec (HANDLE_SBR_DEC hSbrDec, FIXP_DBL **OverlapBufferReal = hSbrDec->QmfBufferReal; FIXP_DBL **OverlapBufferImag = hSbrDec->QmfBufferImag; + if (!hSbrDec->LppTrans.pSettings) { + return SBRDEC_NOT_INITIALIZED; + } + /* assign qmf time slots */ assignTimeSlots( hSbrDec, hHeaderData->numberTimeSlots * hHeaderData->timeStep, useLP); -- cgit v1.2.3