Commit e8219912 authored by Huw D M Davies's avatar Huw D M Davies Committed by Alexandre Julliard

Sanity check on font size.

parent 2643894e
...@@ -32,6 +32,8 @@ ...@@ -32,6 +32,8 @@
#define MAX_FONT_FAMILIES 128 #define MAX_FONT_FAMILIES 128
#define MAX_LFD_LENGTH 256 #define MAX_LFD_LENGTH 256
#define MAX_FONT_SIZE 5000 /* Max size in pixels */
#define REMOVE_SUBSETS 1 #define REMOVE_SUBSETS 1
#define UNMARK_SUBSETS 0 #define UNMARK_SUBSETS 0
...@@ -2225,6 +2227,13 @@ static X_PHYSFONT XFONT_RealizeFont( LPLOGFONT16 plf ) ...@@ -2225,6 +2227,13 @@ static X_PHYSFONT XFONT_RealizeFont( LPLOGFONT16 plf )
plf->lfCharSet, plf->lfFaceName, plf->lfHeight, plf->lfCharSet, plf->lfFaceName, plf->lfHeight,
plf->lfWeight, (plf->lfItalic) ? "Italic" : "" ); plf->lfWeight, (plf->lfItalic) ? "Italic" : "" );
if(abs(plf->lfHeight) > MAX_FONT_SIZE) {
ERR(font,
"plf->lfHeight = %d, this is probably not right. Setting to 100\n",
plf->lfHeight);
plf->lfHeight = 100;
}
XFONT_MatchDeviceFont( fontList, &fm ); XFONT_MatchDeviceFont( fontList, &fm );
pfo->fr = fm.pfr; pfo->fr = fm.pfr;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment