Nikolay Sivov : dwrite: Allow null arguments in opentype_get_font_table().
Module: wine Branch: master Commit: 34823028e17c3f34e1e7e23642ef4239841a1750 URL: http://source.winehq.org/git/wine.git/?a=commit;h=34823028e17c3f34e1e7e23642... Author: Nikolay Sivov <nsivov(a)codeweavers.com> Date: Mon Oct 27 11:26:22 2014 +0300 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 c007b35..c6f7a52 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); }
participants (1)
-
Alexandre Julliard