mirror of
https://github.com/morgan9e/FreeRDP
synced 2026-04-14 08:24:16 +09:00
Fixed possible NULL dereference
This commit is contained in:
5
libfreerdp/cache/bitmap.c
vendored
5
libfreerdp/cache/bitmap.c
vendored
@@ -281,11 +281,12 @@ rdpBitmapCache* bitmap_cache_new(rdpSettings* settings)
|
||||
bitmapCache->settings = settings;
|
||||
bitmapCache->update = ((freerdp*)settings->instance)->update;
|
||||
bitmapCache->context = bitmapCache->update->context;
|
||||
bitmapCache->maxCells = settings->BitmapCacheV2NumCells;
|
||||
bitmapCache->cells = (BITMAP_V2_CELL*)calloc(bitmapCache->maxCells, sizeof(BITMAP_V2_CELL));
|
||||
bitmapCache->cells =
|
||||
(BITMAP_V2_CELL*)calloc(settings->BitmapCacheV2NumCells, sizeof(BITMAP_V2_CELL));
|
||||
|
||||
if (!bitmapCache->cells)
|
||||
goto fail;
|
||||
bitmapCache->maxCells = settings->BitmapCacheV2NumCells;
|
||||
|
||||
for (i = 0; i < (int)bitmapCache->maxCells; i++)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user