Skip to content

Commit

Permalink
Fix potential crash in FontAdd() if LINUX font file doesn't exist
Browse files Browse the repository at this point in the history
  • Loading branch information
ImpulseAdventure committed Oct 23, 2018
1 parent 55c8de3 commit e3541cd
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/GUIslice.c
Expand Up @@ -1319,6 +1319,9 @@ bool gslc_FontAdd(gslc_tsGui* pGui,int16_t nFontId,gslc_teFontRefType eFontRefTy
} else {
// Fetch a font resource from the driver
const void* pvFont = gslc_DrvFontAdd(eFontRefType,pvFontRef,nFontSz);
if (pvFont == NULL) {
return false;
}

pGui->asFont[pGui->nFontCnt].eFontRefType = eFontRefType;
pGui->asFont[pGui->nFontCnt].pvFont = pvFont;
Expand Down

0 comments on commit e3541cd

Please sign in to comment.