Skip to content
Snippets Groups Projects
Commit b0eb0893 authored by Deucе's avatar Deucе :ok_hand_tone4:
Browse files

Handle case when font[0] == NULL

Shouldn't happen, but if it does, return an error, don't dereference
Found by scan-build.
parent da72f6c5
No related branches found
No related tags found
No related merge requests found
...@@ -582,6 +582,8 @@ static int bitmap_draw_one_char(struct vmem_cell *vc, unsigned int xpos, unsigne ...@@ -582,6 +582,8 @@ static int bitmap_draw_one_char(struct vmem_cell *vc, unsigned int xpos, unsigne
if (this_font == NULL) { if (this_font == NULL) {
this_font = font[0]; this_font = font[0];
} }
if (this_font == NULL)
return(-1);
fdw = vstat.charwidth - (vstat.flags & VIDMODES_FLAG_EXPAND) ? 1 : 0; fdw = vstat.charwidth - (vstat.flags & VIDMODES_FLAG_EXPAND) ? 1 : 0;
fontoffset=(sch) * (vstat.charheight * ((fdw + 7) / 8)); fontoffset=(sch) * (vstat.charheight * ((fdw + 7) / 8));
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment