Feed more input data when necessary for ADTS

This fixes cases where an ADTS header could set numberOfRawDataBlocks
to a number larger than 1, which would lead to transportDec_FillData
not feeding any more data, even though the input buffer was depleted.

Fixes: 3014/clusterfuzz-testcase-5425740193464320

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
This commit is contained in:
Martin Storsjo 2017-08-15 16:36:05 +03:00
parent b257494414
commit 5e053a4005
1 changed files with 1 additions and 1 deletions

View File

@ -665,7 +665,7 @@ TRANSPORTDEC_ERROR transportDec_FillData(const HANDLE_TRANSPORTDEC hTp,
return TRANSPORTDEC_OK; return TRANSPORTDEC_OK;
} }
if (hTp->numberOfRawDataBlocks <= 0) { if (hTp->numberOfRawDataBlocks <= 0 || FDKgetValidBits(hBs) == 0) {
FDKfeedBuffer(hBs, pBuffer, bufferSize, pBytesValid); FDKfeedBuffer(hBs, pBuffer, bufferSize, pBytesValid);
} }
} }