mirror of
https://github.com/moonlight-stream/moonlight-common-c.git
synced 2025-08-18 09:25:49 +00:00
Validate block size before writing data
This commit is contained in:
parent
2228e4812d
commit
ca7a6e7bbe
@ -191,7 +191,14 @@ static PRTPA_FEC_BLOCK getFecBlockForRtpPacket(PRTP_AUDIO_QUEUE queue, PRTP_PACK
|
|||||||
LC_ASSERT(existingBlock->fecHeader.payloadType == fecBlockPayloadType);
|
LC_ASSERT(existingBlock->fecHeader.payloadType == fecBlockPayloadType);
|
||||||
LC_ASSERT(existingBlock->fecHeader.baseTimestamp == fecBlockBaseTs);
|
LC_ASSERT(existingBlock->fecHeader.baseTimestamp == fecBlockBaseTs);
|
||||||
LC_ASSERT(existingBlock->fecHeader.ssrc == fecBlockSsrc);
|
LC_ASSERT(existingBlock->fecHeader.ssrc == fecBlockSsrc);
|
||||||
LC_ASSERT(existingBlock->blockSize == blockSize);
|
|
||||||
|
// The block size must match in order to safely copy shards into it
|
||||||
|
if (existingBlock->blockSize != blockSize) {
|
||||||
|
LC_ASSERT(existingBlock->blockSize == blockSize);
|
||||||
|
Limelog("Audio block size mismatch (got %u, expected %u)\n",
|
||||||
|
blockSize, existingBlock->blockSize);
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
// If the block is completed, don't return it
|
// If the block is completed, don't return it
|
||||||
return existingBlock->fullyReassembled ? NULL : existingBlock;
|
return existingBlock->fullyReassembled ? NULL : existingBlock;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user