From f13a0ad2d94344877d3ea42acb1821c13ae0dfad Mon Sep 17 00:00:00 2001 From: rcombs Date: Tue, 5 May 2020 21:32:56 -0500 Subject: render: silence a couple LLVM static analyzer warnings The while() checked the pointer for nullness, so the analyzer assumed it could potentially be null, and thus warned on the reference to it later. Using a do/while instead means we're only checking for subsequent linked-list entries, which was the intent here anyway, and avoids the warning. --- libass/ass_render.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/libass/ass_render.c b/libass/ass_render.c index 509e640..622a28a 100644 --- a/libass/ass_render.c +++ b/libass/ass_render.c @@ -1990,10 +1990,10 @@ static void retrieve_glyphs(ASS_Renderer *render_priv) for (i = 0; i < render_priv->text_info.length; i++) { GlyphInfo *info = glyphs + i; - while (info) { + do { get_outline_glyph(render_priv, info); info = info->next; - } + } while (info); info = glyphs + i; // Add additional space after italic to non-italic style changes @@ -2022,7 +2022,7 @@ static void preliminary_layout(ASS_Renderer *render_priv) for (int i = 0; i < render_priv->text_info.length; i++) { GlyphInfo *info = render_priv->text_info.glyphs + i; ASS_Vector cluster_pen = pen; - while (info) { + do { info->pos.x = cluster_pen.x; info->pos.y = cluster_pen.y; @@ -2030,7 +2030,7 @@ static void preliminary_layout(ASS_Renderer *render_priv) cluster_pen.y += info->advance.y; info = info->next; - } + } while (info); info = render_priv->text_info.glyphs + i; pen.x += info->cluster_advance.x; pen.y += info->cluster_advance.y; -- cgit v1.2.3