mirror of
https://github.com/moonlight-stream/moonlight-common-c.git
synced 2025-08-17 17:05:50 +00:00
Fix freeing of a stack allocation. Fix bad LC_ASSERT definition on non-Windows platforms
This commit is contained in:
parent
462b1d1e9b
commit
00de922f34
@ -25,5 +25,5 @@
|
||||
#include <crtdbg.h>
|
||||
#define LC_ASSERT _ASSERTE
|
||||
#else
|
||||
#define LC_ASSERT
|
||||
#define LC_ASSERT(x)
|
||||
#endif
|
@ -131,7 +131,7 @@ static void DecoderThreadProc(void* context) {
|
||||
}
|
||||
|
||||
int readFirstFrame(void) {
|
||||
char firstFrame[1000];
|
||||
char* firstFrame;
|
||||
int err;
|
||||
int offset = 0;
|
||||
|
||||
@ -140,6 +140,11 @@ int readFirstFrame(void) {
|
||||
return LastSocketError();
|
||||
}
|
||||
|
||||
firstFrame = (char*)malloc(1500);
|
||||
if (firstFrame == NULL) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
Limelog("Waiting for first frame\n");
|
||||
for (;;) {
|
||||
err = recv(firstFrameSocket, &firstFrame[offset], sizeof(firstFrame) - offset, 0);
|
||||
|
Loading…
x
Reference in New Issue
Block a user