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

View file

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