CreateFontIndirect() can get NULL pointers.

This commit is contained in:
Marcus Meissner 2000-12-29 19:40:43 +00:00 committed by Alexandre Julliard
parent 1c80bc927e
commit 46384145ed
1 changed files with 11 additions and 4 deletions

View File

@ -353,8 +353,12 @@ HFONT WINAPI CreateFontIndirectA( const LOGFONTA *font )
{ {
LOGFONT16 font16; LOGFONT16 font16;
FONT_LogFont32ATo16( font, &font16 ); if (font) {
return CreateFontIndirect16( &font16 ); FONT_LogFont32ATo16( font, &font16 );
return CreateFontIndirect16( &font16 );
} else
return CreateFontIndirect16( NULL );
} }
/*********************************************************************** /***********************************************************************
@ -364,8 +368,11 @@ HFONT WINAPI CreateFontIndirectW( const LOGFONTW *font )
{ {
LOGFONT16 font16; LOGFONT16 font16;
FONT_LogFont32WTo16( font, &font16 ); if (font) {
return CreateFontIndirect16( &font16 ); FONT_LogFont32WTo16( font, &font16 );
return CreateFontIndirect16( &font16 );
} else
return CreateFontIndirect16( NULL );
} }
/*********************************************************************** /***********************************************************************