From eaf0c44ef0bb0143e5eee07e92e8b9127faf06a4 Mon Sep 17 00:00:00 2001 From: jcdr428 <56721609+jcdr428@users.noreply.github.com> Date: Tue, 24 May 2022 14:38:35 +0100 Subject: [PATCH] [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. --- tsMuxer/metaDemuxer.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tsMuxer/metaDemuxer.cpp b/tsMuxer/metaDemuxer.cpp index 1ae2073..af863d3 100644 --- a/tsMuxer/metaDemuxer.cpp +++ b/tsMuxer/metaDemuxer.cpp @@ -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);