1
0
Fork 0
mirror of git://git.code.sf.net/p/cdesktopenv/code synced 2025-02-15 04:32:24 +00:00

dtudcfonted/gpftobdf.c: Coverity CID 175168; NULL deref

This commit is contained in:
Jon Trulson 2018-04-02 18:23:22 -06:00
parent 45bccb474c
commit ba95bbc073

View file

@ -1466,9 +1466,19 @@ int fix ;
bitmap = pcf->bitmaps + getINT32( (unsigned char *)(pcf->offsets + encodingOffset),
pcf->bmp_fmt);
invertBits( bitmap + bmp_adj, pcf->bmp_fmt, ptn_width, cpy_height, bmp_ptn + ptn_adj);
putPtn( (unsigned char *)bmp_ptn, ptn_width, ptn_height );
fprintf(stdout,"ENDCHAR\n");
/* Only do this if non-NULL... */
if (bmp_ptn)
{
invertBits( bitmap + bmp_adj, pcf->bmp_fmt,
ptn_width, cpy_height, bmp_ptn + ptn_adj);
putPtn( (unsigned char *)bmp_ptn, ptn_width, ptn_height );
}
else
{
fprintf(stderr, "%s: bmp_ptn is NULL", __FUNCTION__);
}
fprintf(stdout,"ENDCHAR\n");
if( fix == FALSE ) free(bmp_ptn);
}
if( fix == TRUE ) free(bmp_ptn);