mfreerdp-server: fixed some conditions that will crash the server

This commit is contained in:
C-o-r-E 2012-12-11 22:07:56 -05:00
parent 0f29376911
commit a060c8894d
2 changed files with 27 additions and 3 deletions

View File

@ -86,7 +86,29 @@ void (^streamHandler)(CGDisplayStreamFrameStatus, uint64_t, IOSurfaceRef, CGDisp
dispatch_semaphore_signal(data_sem);
}
if (lastUpdate == NULL)
if (status != kCGDisplayStreamFrameStatusFrameComplete)
{
//unhandled
switch(status)
{
case kCGDisplayStreamFrameStatusFrameIdle:
printf("kCGDisplayStreamFrameStatusFrameIdle\n");
break;
case kCGDisplayStreamFrameStatusStopped:
printf("kCGDisplayStreamFrameStatusStopped\n");
break;
case kCGDisplayStreamFrameStatusFrameBlank:
printf("kCGDisplayStreamFrameStatusFrameBlank\n");
break;
default:
printf("Unhandled Frame Status!!!\n");
}
}
else if (lastUpdate == NULL)
{
CFRetain(updateRef);
lastUpdate = updateRef;

View File

@ -26,6 +26,8 @@
#include <freerdp/codec/rfx.h>
#include <freerdp/utils/stream.h>
#include <winpr/crt.h>
#include "mf_peer.h"
#include "mf_info.h"
#include "mf_event.h"
@ -504,8 +506,8 @@ void* mf_peer_main_loop(void* arg)
mf_peer_init(client);
/* Initialize the real server settings here */
client->settings->CertificateFile = "server.crt";
client->settings->PrivateKeyFile = "server.key";
client->settings->CertificateFile = _strdup("server.crt");
client->settings->PrivateKeyFile = _strdup("server.key");
client->settings->NlaSecurity = FALSE;
client->settings->RemoteFxCodec = TRUE;
client->settings->SuppressOutput = TRUE;