Skip to content

Commit 4aa26de

Browse files
committed
Avoiding &adjustments[0] containing garbage and causing segfault
1 parent 1161524 commit 4aa26de

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/skia/Font.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -612,7 +612,7 @@ typeface
612612
const std::vector<SkGlyphID>& glyphs) -> py::object {
613613
std::vector<int32_t> adjustments(glyphs.size() - 1);
614614
auto result = typeface.getKerningPairAdjustments(
615-
&glyphs[0], glyphs.size(), &adjustments[0]);
615+
&glyphs[0], glyphs.size(), (glyphs.size() > 1) ? &adjustments[0] : nullptr);
616616
if (!result) {
617617
// Kerning is not supported for this typeface.
618618
return py::none();

0 commit comments

Comments
 (0)