[bug] Limit readCnt to DEFAULT_FILE_BLOCK_SIZE

The size of the data read from the stream and copied to the buffer should be limited to DEFAULT_FILE_BLOCK_SIZE to avoid the 'Not enough buffer for parse video stream' error.
This commit is contained in:
jcdr428 2022-05-24 14:38:35 +01:00 committed by GitHub
parent 24ae93589c
commit eaf0c44ef0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1357,7 +1357,7 @@ uint8_t* ContainerToReaderWrapper::readBlock(uint32_t readerID, uint32_t& readCn
<< demuxerData.m_streamName);
}
m_discardedSize += discardSize;
readCnt = (uint32_t)(streamData.size() - m_readBuffOffset);
readCnt = (uint32_t)(FFMIN(streamData.size(), nFileBlockSize) - m_readBuffOffset);
} while (demuxRez == 0 && readCnt < MIN_READED_BLOCK && policy != DemuxerReadPolicy::drpFragmented &&
!m_terminated);