From 00de922f345979ea5a3bd99e2f7e78bb4829ba4f Mon Sep 17 00:00:00 2001 From: Cameron Gutman Date: Mon, 20 Jan 2014 21:55:48 -0500 Subject: [PATCH] Fix freeing of a stack allocation. Fix bad LC_ASSERT definition on non-Windows platforms --- limelight-common/Platform.h | 2 +- limelight-common/VideoStream.c | 7 ++++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/limelight-common/Platform.h b/limelight-common/Platform.h index 02df517..b5cc3df 100644 --- a/limelight-common/Platform.h +++ b/limelight-common/Platform.h @@ -25,5 +25,5 @@ #include #define LC_ASSERT _ASSERTE #else -#define LC_ASSERT +#define LC_ASSERT(x) #endif \ No newline at end of file diff --git a/limelight-common/VideoStream.c b/limelight-common/VideoStream.c index fc0b367..991e39e 100644 --- a/limelight-common/VideoStream.c +++ b/limelight-common/VideoStream.c @@ -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);