mirror of
https://github.com/moonlight-stream/moonlight-common-c.git
synced 2025-08-18 01:15:46 +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>
|
#include <crtdbg.h>
|
||||||
#define LC_ASSERT _ASSERTE
|
#define LC_ASSERT _ASSERTE
|
||||||
#else
|
#else
|
||||||
#define LC_ASSERT
|
#define LC_ASSERT(x)
|
||||||
#endif
|
#endif
|
@ -131,7 +131,7 @@ static void DecoderThreadProc(void* context) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
int readFirstFrame(void) {
|
int readFirstFrame(void) {
|
||||||
char firstFrame[1000];
|
char* firstFrame;
|
||||||
int err;
|
int err;
|
||||||
int offset = 0;
|
int offset = 0;
|
||||||
|
|
||||||
@ -140,6 +140,11 @@ int readFirstFrame(void) {
|
|||||||
return LastSocketError();
|
return LastSocketError();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
firstFrame = (char*)malloc(1500);
|
||||||
|
if (firstFrame == NULL) {
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
Limelog("Waiting for first frame\n");
|
Limelog("Waiting for first frame\n");
|
||||||
for (;;) {
|
for (;;) {
|
||||||
err = recv(firstFrameSocket, &firstFrame[offset], sizeof(firstFrame) - offset, 0);
|
err = recv(firstFrameSocket, &firstFrame[offset], sizeof(firstFrame) - offset, 0);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user