iOS: Fixed possible crash on disconnect

This commit is contained in:
Martin Fleisz 2013-04-17 13:09:53 +02:00
parent b4b0fb0642
commit ce4e02ae48
2 changed files with 5 additions and 3 deletions

View File

@ -190,7 +190,9 @@ NSString* TSXSessionDidFailToConnectNotification = @"TSXSessionDidFailToConnect"
- (CGContextRef)bitmapContext
{
return [self mfi]->bitmap_context;
if ([self mfi]->connection_state == TSXConnectionConnected)
return [self mfi]->bitmap_context;
return NULL;
}
#pragma mark -

View File

@ -27,9 +27,9 @@
int _der_skip_length(int length)
{
if (length > 0x81 && length <= 0x102)
if (length > 0x7F && length <= 0xFF)
return 2;
else if (length > 0x102)
else if (length > 0xFF)
return 3;
else
return 1;