From: Armin Novak Date: Wed, 17 May 2017 13:58:32 +0000 (+0200) Subject: Fixed missing argument checks. X-Git-Tag: 2.0.0-rc0~30^2~1 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=6649eed659ebe2bddb2d9dd1aa2027141bb888b5;p=platform%2Fupstream%2Ffreerdp.git Fixed missing argument checks. --- diff --git a/libfreerdp/cache/offscreen.c b/libfreerdp/cache/offscreen.c index dacc1d9..1b7c2b0 100644 --- a/libfreerdp/cache/offscreen.c +++ b/libfreerdp/cache/offscreen.c @@ -44,7 +44,12 @@ static BOOL update_gdi_create_offscreen_bitmap(rdpContext* context, UINT32 i; UINT16 index; rdpBitmap* bitmap; - rdpCache* cache = context->cache; + rdpCache* cache; + + if (!context || !createOffscreenBitmap || !context->cache) + return FALSE; + + cache = context->cache; bitmap = Bitmap_Alloc(context); if (!bitmap) @@ -77,8 +82,16 @@ static BOOL update_gdi_create_offscreen_bitmap(rdpContext* context, static BOOL update_gdi_switch_surface(rdpContext* context, const SWITCH_SURFACE_ORDER* switchSurface) { - rdpCache* cache = context->cache; - rdpBitmap* bitmap = context->graphics->Bitmap_Prototype; + rdpCache* cache; + rdpBitmap* bitmap; + + if (!context || !context->cache || !switchSurface || !context->graphics) + return FALSE; + + cache = context->cache; + bitmap = context->graphics->Bitmap_Prototype; + if (!bitmap) + return FALSE; if (switchSurface->bitmapId == SCREEN_BITMAP_SURFACE) {