mirror of
https://github.com/moonlight-stream/moonlight-common-c.git
synced 2026-11-29 01:04:41 +00:00
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:
1 parent
171858c2e7
commit
ec6713fd80
3 files changed
+30
-9
No files matched your search
@@ -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);
|
||||
|
||||
Reference in new issue
Block a user