Skip to content

Commit

Permalink
experimental: validate input for font_pick(NULL)
Browse files Browse the repository at this point in the history
  • Loading branch information
dk committed Sep 19, 2024
1 parent 514d97f commit fb39cfe
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
5 changes: 2 additions & 3 deletions unix/font.c
Original file line number Diff line number Diff line change
Expand Up @@ -589,10 +589,9 @@ prima_font_pick( PFont source, Matrix matrix, PFont dest, unsigned int selection
if ( selection == 0 )
selection = FONTKEY_DEFAULT;

if ( dest != NULL )
Drawable_font_add( NULL_HANDLE, source, dest );
else
if ( dest == NULL )
dest = source;
Drawable_font_add( NULL_HANDLE, source, dest );

#ifdef USE_FONTQUERY
if ( selection & FONTKEY_FREETYPE )
Expand Down
4 changes: 3 additions & 1 deletion win32/stock.c
Original file line number Diff line number Diff line change
Expand Up @@ -1573,8 +1573,10 @@ apc_font_pick( Handle self, PFont source, PFont dest)
if ( dest != NULL ) {
Drawable_font_add( NULL_HANDLE, source, dest );
source = dest;
} else
} else {
dest = source;
Drawable_font_add( NULL_HANDLE, source, dest );
}
if ( self && is_opt(optInFontQuery))
res.x = res.y = 72;
else
Expand Down

0 comments on commit fb39cfe

Please sign in to comment.