Fix infinite loop when blockSize = 0 (#442)
A situation can occur where tsMuxer tries to extract data from a block which is not a PG track, and blocksize = 0 results in an infinite loop. Fixes #440.
This commit is contained in:
parent
8028fb8449
commit
a80cd66b86
@ -364,10 +364,12 @@ void ParsedPGTrackData::extractData(AVPacket* pkt, uint8_t* buff, int size)
|
||||
while (curPtr <= end - 3)
|
||||
{
|
||||
uint16_t blockSize = AV_RB16(curPtr + 1) + 3;
|
||||
if (blockSize == 0)
|
||||
break;
|
||||
curPtr += blockSize;
|
||||
blocks++;
|
||||
}
|
||||
assert(curPtr == end);
|
||||
// assert(curPtr == end);
|
||||
if (curPtr != end)
|
||||
{
|
||||
pkt->size = 0;
|
||||
|
Loading…
x
Reference in New Issue
Block a user