Skip to content

Commit

Permalink
fix: fix crash when no default fonts are found (AcademySoftwareFounda…
Browse files Browse the repository at this point in the history
…tion#4249)

The nullptr at the end of default_font_name was left over from a time
that we iterated by going through array elements until we hit the
nullptr that signalled we had passed the last valid element. At some
point we switched to a range-for, which iterates over every element of
the array without needing an "end sentinel", and we should have
eliminated the nullptr but failed to do so.

Fixes AcademySoftwareFoundation#4248

Signed-off-by: Larry Gritz <lg@larrygritz.com>
  • Loading branch information
lgritz authored Apr 30, 2024
1 parent 92701f7 commit 69b91d3
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/libOpenImageIO/imagebufalgo_draw.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -883,7 +883,7 @@ static FT_Library ft_library = NULL;
static bool ft_broken = false;

static const char* default_font_name[] = { "DroidSans", "cour", "Courier New",
"FreeMono", nullptr };
"FreeMono" };



Expand Down

0 comments on commit 69b91d3

Please sign in to comment.