Fix freeing of a stack allocation. Fix bad LC_ASSERT definition on non-Windows platforms
This commit is contained in:
parent
462b1d1e9b
commit
00de922f34
2 changed files with 7 additions and 2 deletions
|
|
@ -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…
Add table
Add a link
Reference in a new issue