FEXServer: Be robust against invalid packets.

Chrome seems to like sending us invalid packets of data sometimes. With
an invalid packet type just skip parsing the data entirely.

Fixes an infinite loop in Vampire Survivors.
This commit is contained in:
Ryan Houdek committed 2022-10-31 12:05:48 -07:00
1 parent 70a3ceb64e
commit a0fb9531db
1 file changed
+3
+3
View File
@@ -431,6 +431,9 @@ namespace ProcessPipe {
// Invalid
case FEXServerClient::PacketType::TYPE_ERROR:
default:
// Something sent us an invalid packet. To ensure we don't spin infinitely, consume all the data.
LogMan::Msg::EFmt("[FEXServer] InvalidPacket size received 0x{:x} bytes", CurrentRead - CurrentOffset);
CurrentOffset = CurrentRead;
break;
}
}