From 85ce07d3e0be427996be0e2397f47e7e657c5fa1 Mon Sep 17 00:00:00 2001 From: CastagnaIT Date: Fri, 9 Aug 2024 17:47:46 +0200 Subject: [PATCH] [ADTSReader] Return false when id3tagparsr fails CADTSSampleReader::ReadSample call ADTSReader::ReadPacket each time kodi request buffer data but when the stream buffer reach the end the m_id3TagParser.parse cannot read data from m_stream by returning ID3TAG::PARSE_FAIL this was breaking the while loop and return true since return true was causing that CADTSSampleReader::ReadSample to return AP4_SUCCESS with bad data where instead was needed to check for waitingForSegment and mark the m_eos as true, this to allow stop the playback and so avoid flooding kodi demuxer of bad package data --- src/demuxers/ADTSReader.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/demuxers/ADTSReader.cpp b/src/demuxers/ADTSReader.cpp index a9eb85372..9d8f87b84 100644 --- a/src/demuxers/ADTSReader.cpp +++ b/src/demuxers/ADTSReader.cpp @@ -429,7 +429,7 @@ bool ADTSReader::ReadPacket() if ((id3Ret = m_id3TagParser.parse(m_stream)) == ID3TAG::PARSE_SUCCESS) continue; else if (id3Ret == ID3TAG::PARSE_FAIL) - break; + return false; if (m_id3TagParser.getPts(m_basePts)) m_frameParser.resetFrameCount();