Merge pull request #4121 from ondrejholy/setsurface-segfault-fix
Various fixes from #4117
This commit is contained in:
commit
a514ae9638
@ -202,6 +202,10 @@ static BOOL xf_Bitmap_SetSurface(rdpContext* context, rdpBitmap* bitmap,
|
||||
BOOL primary)
|
||||
{
|
||||
xfContext* xfc = (xfContext*) context;
|
||||
|
||||
if (!context || (!bitmap && !primary))
|
||||
return FALSE;
|
||||
|
||||
xf_lock_x11(xfc, FALSE);
|
||||
|
||||
if (primary)
|
||||
|
5
libfreerdp/cache/offscreen.c
vendored
5
libfreerdp/cache/offscreen.c
vendored
@ -60,7 +60,7 @@ static BOOL update_gdi_create_offscreen_bitmap(rdpContext* context,
|
||||
|
||||
if (!bitmap->New(context, bitmap))
|
||||
{
|
||||
free(bitmap);
|
||||
Bitmap_Free(context, bitmap);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
@ -101,6 +101,9 @@ static BOOL update_gdi_switch_surface(rdpContext* context,
|
||||
{
|
||||
rdpBitmap* bmp;
|
||||
bmp = offscreen_cache_get(cache->offscreen, switchSurface->bitmapId);
|
||||
if (bmp == NULL)
|
||||
return FALSE;
|
||||
|
||||
bitmap->SetSurface(context, bmp, FALSE);
|
||||
}
|
||||
|
||||
|
@ -2460,7 +2460,7 @@ static BOOL update_read_create_offscreen_bitmap_order(wStream* s,
|
||||
if (deleteList->cIndices > deleteList->sIndices)
|
||||
{
|
||||
UINT16* new_indices;
|
||||
new_indices = (UINT16*)realloc(deleteList->indices, deleteList->sIndices * 2);
|
||||
new_indices = (UINT16*)realloc(deleteList->indices, deleteList->cIndices * 2);
|
||||
|
||||
if (!new_indices)
|
||||
return FALSE;
|
||||
@ -3451,7 +3451,7 @@ static BOOL update_recv_altsec_order(rdpUpdate* update, wStream* s,
|
||||
break;
|
||||
|
||||
case ORDER_TYPE_GDIPLUS_END:
|
||||
if (update_read_draw_gdiplus_end_order(s, &(altsec->draw_gdiplus_end)))
|
||||
if (!update_read_draw_gdiplus_end_order(s, &(altsec->draw_gdiplus_end)))
|
||||
{
|
||||
WLog_ERR(TAG,
|
||||
"ORDER_TYPE_GDIPLUS_END - update_read_draw_gdiplus_end_order() failed");
|
||||
|
Loading…
Reference in New Issue
Block a user