diff --git a/srcpkgs/lagrange/patches/fix-crash-select-text.patch b/srcpkgs/lagrange/patches/fix-crash-select-text.patch new file mode 100644 index 00000000000..0591157ba27 --- /dev/null +++ b/srcpkgs/lagrange/patches/fix-crash-select-text.patch @@ -0,0 +1,26 @@ +From 1fe2b10bc1a2def2af86390272907206f819b7ae Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Jaakko=20Kera=CC=88nen?= +Date: Sun, 3 Oct 2021 08:02:58 +0300 +Subject: [PATCH] GmDocument: Fixed a crash when selecting text + +--- + src/gmdocument.c | 5 ++++- + 1 file changed, 4 insertions(+), 1 deletion(-) + +diff --git a/src/gmdocument.c b/src/gmdocument.c +index 22f409a..2f4c797 100644 +--- a/src/gmdocument.c ++++ b/src/gmdocument.c +@@ -2074,8 +2074,11 @@ iRangecc findLoc_GmRun(const iGmRun *d, iInt2 pos) { + iRangecc loc; + tryAdvanceNoWrap_Text(d->textParams.font, d->text, x, &loc.start); + loc.end = loc.start; ++ if (!contains_Range(&d->text, loc.start)) { ++ return iNullRange; /* it's some other text */ ++ } + iChar ch; +- if (d->text.end != loc.start) { ++ if (d->text.end && d->text.end != loc.start) { + int chLen = decodeBytes_MultibyteChar(loc.start, d->text.end, &ch); + if (chLen > 0) { + /* End after the character. */ diff --git a/srcpkgs/lagrange/template b/srcpkgs/lagrange/template index 0233fd1eaf1..3d8851ba443 100644 --- a/srcpkgs/lagrange/template +++ b/srcpkgs/lagrange/template @@ -1,7 +1,7 @@ # Template file for 'lagrange' pkgname=lagrange version=1.6.5 -revision=1 +revision=2 build_style=cmake hostmakedepends="pkg-config" makedepends="pcre-devel SDL2-devel openssl-devel zlib-devel libunistring-devel