summaryrefslogtreecommitdiffstats
path: root/libass
diff options
context:
space:
mode:
authorrcombs <rcombs@rcombs.me>2020-05-05 21:32:56 -0500
committerrcombs <rcombs@rcombs.me>2020-05-26 20:56:44 -0500
commitf13a0ad2d94344877d3ea42acb1821c13ae0dfad (patch)
treed2f5afda1db76f1d42273f0d64b943168f8e345b /libass
parentc9b57443c8750799fd40a4ed3ebc0716d57d8dd7 (diff)
downloadlibass-f13a0ad2d94344877d3ea42acb1821c13ae0dfad.tar.bz2
libass-f13a0ad2d94344877d3ea42acb1821c13ae0dfad.tar.xz
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.
Diffstat (limited to 'libass')
-rw-r--r--libass/ass_render.c8
1 files 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;