mirror of
https://github.com/VincentWei/MiniGUI.git
synced 2026-09-24 09:14:09 +08:00
fix bug of free null pointer
This commit is contained in:
@@ -397,7 +397,7 @@ build_bmpfont_info (const char *bmpfont_name, const BITMAP* glyph_bmp,
|
||||
return NULL;
|
||||
|
||||
/* set name */
|
||||
strncpy (bmpfont_info->name , bmpfont_name, LEN_UNIDEVFONT_NAME);
|
||||
strncpy (bmpfont_info->name, bmpfont_name, LEN_UNIDEVFONT_NAME);
|
||||
bmpfont_info->name [LEN_UNIDEVFONT_NAME] = '\0';
|
||||
|
||||
/* set height */
|
||||
|
||||
+2
-1
@@ -3556,7 +3556,8 @@ static void destroy_dc_state (DCSTATE* dc_state, BOOL empty_crgn)
|
||||
{
|
||||
if (empty_crgn)
|
||||
EmptyClipRgn (&dc_state->lcrgn);
|
||||
free (dc_state->pal.colors);
|
||||
if (dc_state->pal.colors)
|
||||
free (dc_state->pal.colors);
|
||||
free (dc_state);
|
||||
}
|
||||
|
||||
|
||||
+2
-1
@@ -311,7 +311,8 @@ HICON GUIAPI LoadIconFromMem (HDC hdc, const void* area, int which)
|
||||
imagew = MGUI_ReadLE32Mem (&p);
|
||||
imageh = MGUI_ReadLE32Mem (&p);
|
||||
#else
|
||||
p += sizeof(DWORD32);
|
||||
p += sizeof(DWORD32);
|
||||
p += sizeof(DWORD32);
|
||||
#endif
|
||||
/* check the biPlanes member; */
|
||||
wTemp = MGUI_ReadLE16Mem (&p);
|
||||
|
||||
Reference in New Issue
Block a user