Improve checks for runt video packets

Since we always allocate fixed size these aren't likely to be exploitable,
but we ought to fix them anyway. Worst case, we will just read some garbage
and generate corrupt video output.
This commit is contained in:
Cameron Gutman committed 2023-09-12 22:44:45 -05:00
1 parent 171858c2e7
commit ec6713fd80
3 files changed
+30 -9

No files matched your search

+5
View File
@@ -151,6 +151,11 @@ static void VideoReceiveThreadProc(void* context) {
}
}
if (err < (int)sizeof(RTP_PACKET)) {
// Runt packet
continue;
}
// Convert fields to host byte-order
packet = (PRTP_PACKET)&buffer[0];
packet->sequenceNumber = BE16(packet->sequenceNumber);