From 69b91d36f85752de97647037313e975dc0797d90 Mon Sep 17 00:00:00 2001 From: Larry Gritz Date: Mon, 29 Apr 2024 19:15:01 -0700 Subject: [PATCH] fix: fix crash when no default fonts are found (#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 #4248 Signed-off-by: Larry Gritz --- src/libOpenImageIO/imagebufalgo_draw.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/libOpenImageIO/imagebufalgo_draw.cpp b/src/libOpenImageIO/imagebufalgo_draw.cpp index a6878f584a..2e6f89a2b2 100644 --- a/src/libOpenImageIO/imagebufalgo_draw.cpp +++ b/src/libOpenImageIO/imagebufalgo_draw.cpp @@ -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" };