From 34823028e17c3f34e1e7e23642ef4239841a1750 Mon Sep 17 00:00:00 2001 From: Nikolay Sivov Date: Mon, 27 Oct 2014 11:26:22 +0300 Subject: [PATCH] dwrite: Allow null arguments in opentype_get_font_table(). --- dlls/dwrite/opentype.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/dlls/dwrite/opentype.c b/dlls/dwrite/opentype.c index c007b351ac5..c6f7a526b1b 100644 --- a/dlls/dwrite/opentype.c +++ b/dlls/dwrite/opentype.c @@ -322,7 +322,8 @@ HRESULT opentype_get_font_table(IDWriteFontFileStream *stream, DWRITE_FONT_FACE_ int table_count, table_offset = 0; int i; - *found = FALSE; + if (found) *found = FALSE; + if (table_size) *table_size = 0; if (type == DWRITE_FONT_FACE_TYPE_TRUETYPE_COLLECTION) { const TTC_Header_V1 *ttc_header; @@ -363,8 +364,8 @@ HRESULT opentype_get_font_table(IDWriteFontFileStream *stream, DWRITE_FONT_FACE_ int length = GET_BE_DWORD(table_record->length); IDWriteFontFileStream_ReleaseFileFragment(stream, table_record_context); - *found = TRUE; - *table_size = length; + if (found) *found = TRUE; + if (table_size) *table_size = length; hr = IDWriteFontFileStream_ReadFileFragment(stream, table_data, offset, length, table_context); }