gjs/SOURCES/0001-cairo-context-Special-case-0-sized-vector.patch
2021-09-09 17:34:16 +00:00

29 lines
866 B
Diff

From c47b4f6993f1cd7fb346f0e09a0fabb0a158039b Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Florian=20M=C3=BCllner?= <fmuellner@gnome.org>
Date: Fri, 22 Feb 2019 14:16:17 +0100
Subject: [PATCH] cairo-context: Special-case 0-sized vector
---
modules/cairo-context.cpp | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/modules/cairo-context.cpp b/modules/cairo-context.cpp
index e77bde16..35d798a6 100644
--- a/modules/cairo-context.cpp
+++ b/modules/cairo-context.cpp
@@ -582,7 +582,10 @@ setDash_func(JSContext *context,
dashes_c.push_back(b);
}
- cairo_set_dash(cr, &dashes_c[0], dashes_c.size(), offset);
+ if (dashes_c.size() == 0)
+ cairo_set_dash(cr, NULL, 0, offset);
+ else
+ cairo_set_dash(cr, &dashes_c[0], dashes_c.size(), offset);
argv.rval().setUndefined();
return true;
}
--
2.20.1