Commit 533d3b90 authored by Nikolay Sivov's avatar Nikolay Sivov Committed by Alexandre Julliard

dwrite: Trace QueryInterface fontface calls on failure (Coverity).

parent 74f6c996
...@@ -5135,6 +5135,7 @@ HRESULT create_glyphrunanalysis(const struct glyphrunanalysis_desc *desc, IDWrit ...@@ -5135,6 +5135,7 @@ HRESULT create_glyphrunanalysis(const struct glyphrunanalysis_desc *desc, IDWrit
IDWriteFontFace1 *fontface1; IDWriteFontFace1 *fontface1;
D2D_POINT_2F origin; D2D_POINT_2F origin;
FLOAT rtl_factor; FLOAT rtl_factor;
HRESULT hr;
UINT32 i; UINT32 i;
*ret = NULL; *ret = NULL;
...@@ -5196,7 +5197,8 @@ HRESULT create_glyphrunanalysis(const struct glyphrunanalysis_desc *desc, IDWrit ...@@ -5196,7 +5197,8 @@ HRESULT create_glyphrunanalysis(const struct glyphrunanalysis_desc *desc, IDWrit
memcpy(analysis->glyphs, desc->run->glyphIndices, desc->run->glyphCount*sizeof(*desc->run->glyphIndices)); memcpy(analysis->glyphs, desc->run->glyphIndices, desc->run->glyphCount*sizeof(*desc->run->glyphIndices));
IDWriteFontFace_GetMetrics(desc->run->fontFace, &metrics); IDWriteFontFace_GetMetrics(desc->run->fontFace, &metrics);
IDWriteFontFace_QueryInterface(desc->run->fontFace, &IID_IDWriteFontFace1, (void **)&fontface1); if (FAILED(hr = IDWriteFontFace_QueryInterface(desc->run->fontFace, &IID_IDWriteFontFace1, (void **)&fontface1)))
WARN("Failed to get IDWriteFontFace1, %#x.\n", hr);
origin.x = desc->origin_x * desc->ppdip; origin.x = desc->origin_x * desc->ppdip;
origin.y = desc->origin_y * desc->ppdip; origin.y = desc->origin_y * desc->ppdip;
......
...@@ -1449,13 +1449,15 @@ static HRESULT compute_glyph_origins(DWRITE_GLYPH_RUN const *run, DWRITE_MEASURI ...@@ -1449,13 +1449,15 @@ static HRESULT compute_glyph_origins(DWRITE_GLYPH_RUN const *run, DWRITE_MEASURI
IDWriteFontFace1 *fontface1 = NULL; IDWriteFontFace1 *fontface1 = NULL;
DWRITE_FONT_METRICS metrics; DWRITE_FONT_METRICS metrics;
FLOAT rtl_factor; FLOAT rtl_factor;
HRESULT hr;
UINT32 i; UINT32 i;
rtl_factor = run->bidiLevel & 1 ? -1.0f : 1.0f; rtl_factor = run->bidiLevel & 1 ? -1.0f : 1.0f;
if (run->fontFace) { if (run->fontFace) {
IDWriteFontFace_GetMetrics(run->fontFace, &metrics); IDWriteFontFace_GetMetrics(run->fontFace, &metrics);
IDWriteFontFace_QueryInterface(run->fontFace, &IID_IDWriteFontFace1, (void **)&fontface1); if (FAILED(hr = IDWriteFontFace_QueryInterface(run->fontFace, &IID_IDWriteFontFace1, (void **)&fontface1)))
WARN("Failed to get IDWriteFontFace1, %#x.\n", hr);
} }
for (i = 0; i < run->glyphCount; i++) { for (i = 0; i < run->glyphCount; i++) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment