Fixed a crash in the PSI decoder when a packet with an invalid PSI offset is received.
Some checks failed
🚀 Pack skyscraper8 / make-zip (push) Failing after 35s
Some checks failed
🚀 Pack skyscraper8 / make-zip (push) Failing after 35s
This commit is contained in:
parent
a58fb93599
commit
67bc722c66
@ -29,9 +29,6 @@ namespace skyscraper5.Mpeg2
|
|||||||
Span<byte> span = packet.GetPayload();
|
Span<byte> span = packet.GetPayload();
|
||||||
int automataIterations = 0;
|
int automataIterations = 0;
|
||||||
|
|
||||||
if (packet.PID == 0x0881)
|
|
||||||
;
|
|
||||||
|
|
||||||
while(span.Length > 0)
|
while(span.Length > 0)
|
||||||
{
|
{
|
||||||
switch(state)
|
switch(state)
|
||||||
@ -45,6 +42,12 @@ namespace skyscraper5.Mpeg2
|
|||||||
}
|
}
|
||||||
byte startOffset = span[0];
|
byte startOffset = span[0];
|
||||||
span = span.Slice(1);
|
span = span.Slice(1);
|
||||||
|
if (startOffset > span.Length)
|
||||||
|
{
|
||||||
|
logger.WarnFormat("An MPEG-2 section with an invalid starting offsett was found. It will be skipped.");
|
||||||
|
state = 0;
|
||||||
|
return;
|
||||||
|
}
|
||||||
span = span.Slice(startOffset);
|
span = span.Slice(startOffset);
|
||||||
state = 1;
|
state = 1;
|
||||||
break;
|
break;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user