gentoo-ebuilds/media-gfx/mscgen/files/mscgen-0.20-width-never-less-than-zero.patch
Sam James eab3a00efc
media-gfx/mscgen: update EAPI 7 -> 8, unrestrict tests, pull in Fedora/Debian patches
* EAPI 8
* Unrestict tests, which exposes a crash!
* Pull in Fedora/Debian patches to fix aforementioned crash

Closes: https://bugs.gentoo.org/379279
Signed-off-by: Sam James <sam@gentoo.org>
2025-05-30 12:10:22 +01:00

24 lines
820 B
Diff

https://src.fedoraproject.org/rpms/mscgen/blob/rawhide/f/mscgen-0.20-width-never-less-than-zero.patch
Description: don't make width < 0 with an off-by-one fix-up
gdoTextWidth() tries to correct an off-by-one error in the calculated width
of a text bounding box; but doesn't account for the possibility that the
bounding box has a size of zero (which is the case in latest libgd for
zero-width text). Account for this so we aren't accidentally returning
-1 where we mean 0.
Author: Steve Langasek <steve.langasek@ubuntu.com>
Bug-Debian: https://bugs.debian.org/960405
Last-Update: 2020-05-15
--- a/src/gd_out.c
+++ b/src/gd_out.c
@@ -212,7 +212,7 @@
* the right of the last character for the fixed width
* font.
*/
- return rect[2] - 1;
+ return rect[2] ? rect[2] - 1 : 0;
#endif
}