summaryrefslogtreecommitdiffstats
path: root/libvncclient/ultra.c
diff options
context:
space:
mode:
Diffstat (limited to 'libvncclient/ultra.c')
-rw-r--r--libvncclient/ultra.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/libvncclient/ultra.c b/libvncclient/ultra.c
index 32a1b2b..a287526 100644
--- a/libvncclient/ultra.c
+++ b/libvncclient/ultra.c
@@ -66,6 +66,8 @@ HandleUltraBPP (rfbClient* client, int rx, int ry, int rw, int rh)
if ((client->raw_buffer_size % 4)!=0)
client->raw_buffer_size += (4-(client->raw_buffer_size % 4));
client->raw_buffer = (char*) malloc( client->raw_buffer_size );
+ if(client->raw_buffer == NULL)
+ return FALSE;
}
/* allocate enough space to store the incoming compressed packet */
@@ -98,7 +100,7 @@ HandleUltraBPP (rfbClient* client, int rx, int ry, int rw, int rh)
/* Put the uncompressed contents of the update on the screen. */
if ( inflateResult == LZO_E_OK )
{
- CopyRectangle(client, (unsigned char *)client->raw_buffer, rx, ry, rw, rh);
+ client->GotBitmap(client, (unsigned char *)client->raw_buffer, rx, ry, rw, rh);
}
else
{
@@ -150,6 +152,8 @@ HandleUltraZipBPP (rfbClient* client, int rx, int ry, int rw, int rh)
if ((client->raw_buffer_size % 4)!=0)
client->raw_buffer_size += (4-(client->raw_buffer_size % 4));
client->raw_buffer = (char*) malloc( client->raw_buffer_size );
+ if(client->raw_buffer == NULL)
+ return FALSE;
}
@@ -199,7 +203,7 @@ HandleUltraZipBPP (rfbClient* client, int rx, int ry, int rw, int rh)
if (se == rfbEncodingRaw)
{
- CopyRectangle(client, (unsigned char *)ptr, sx, sy, sw, sh);
+ client->GotBitmap(client, (unsigned char *)ptr, sx, sy, sw, sh);
ptr += ((sw * sh) * (BPP / 8));
}
}