mirror of
https://github.com/moonlight-stream/moonlight-common-c.git
synced 2025-08-18 01:15:46 +00:00
Catch forgetting to initialize packetSize field
This commit is contained in:
parent
396b02a94d
commit
42df6475c8
@ -176,11 +176,18 @@ int LiStartConnection(PSERVER_INFORMATION serverInfo, PSTREAM_CONFIGURATION stre
|
|||||||
// FEC only works in 16 byte chunks, so we must round down
|
// FEC only works in 16 byte chunks, so we must round down
|
||||||
// the given packet size to the nearest multiple of 16.
|
// the given packet size to the nearest multiple of 16.
|
||||||
StreamConfig.packetSize -= StreamConfig.packetSize % 16;
|
StreamConfig.packetSize -= StreamConfig.packetSize % 16;
|
||||||
|
|
||||||
|
if (StreamConfig.packetSize == 0) {
|
||||||
|
Limelog("Invalid packet size specified\n");
|
||||||
|
free(RemoteAddrString);
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
// Extract the appversion from the supplied string
|
// Extract the appversion from the supplied string
|
||||||
if (extractVersionQuadFromString(serverInfo->serverInfoAppVersion,
|
if (extractVersionQuadFromString(serverInfo->serverInfoAppVersion,
|
||||||
AppVersionQuad) < 0) {
|
AppVersionQuad) < 0) {
|
||||||
Limelog("Invalid appversion string: %s\n", serverInfo->serverInfoAppVersion);
|
Limelog("Invalid appversion string: %s\n", serverInfo->serverInfoAppVersion);
|
||||||
|
free(RemoteAddrString);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user