* src/font.c (font_open_entity): Fail after 15 iterations through
the loop that looks for a font whose average_width and height are
both positive. This avoids infinite loops for fonts that, e.g.,
report average_width of zero for any possible size we try.
(Bug#31316)
(cherry picked from commit
e2879c1f837059335af89022b2a9ac9bc861e96d)
font = XFONT_OBJECT (font_object);
if (font->average_width > 0 && font->height > 0)
break;
+ /* Avoid an infinite loop. */
+ if (psize > pixel_size + 15)
+ return Qnil;
}
ASET (font_object, FONT_SIZE_INDEX, make_number (pixel_size));
FONT_ADD_LOG ("open", entity, font_object);