gd/gd-freetype.patch
Petr Gajdos b783cebdcb Accepting request 508757 from home:scarabeus_iv:branches:graphics
- Version update to 2.2.4:
  * gdImageCreate() doesn't check for oversized images and as such is prone
    to DoS vulnerabilities. (CVE-2016-9317) bsc#1022283
  * double-free in gdImageWebPtr() (CVE-2016-6912) bsc#1022284
  * potential unsigned underflow in gd_interpolation.c (CVE-2016-10166)
    bsc#1022263
  * DOS vulnerability in gdImageCreateFromGd2Ctx() (CVE-2016-10167)
    bsc#1022264
  * Signed Integer Overflow gd_io.c (CVE-2016-10168) bsc#1022265
- Remove patches merged/obsoleted by upstream:
  * gd-config.patch
  * gd-disable-freetype27-failed-tests.patch
  * gd-test-unintialized-var.patch
- Add patch gd-freetype.patch taking patch from upstream for
  freetype 2.7

OBS-URL: https://build.opensuse.org/request/show/508757
OBS-URL: https://build.opensuse.org/package/show/graphics/gd?expand=0&rev=37
2017-07-17 08:28:43 +00:00

52 lines
1.8 KiB
Diff

From a5570d3ed30ff76c2a8bdd54f4ab1825acca0143 Mon Sep 17 00:00:00 2001
From: "Christoph M. Becker" <cmbecker69@gmx.de>
Date: Sun, 29 Jan 2017 17:07:50 +0100
Subject: [PATCH] Fix #302: Test suite fails with freetype 2.7
Actually, the test failures are not necessarily related to freetype
2.7, but rather are caused by subpixel hinting which is enabled by
default in freetype 2.7. Subpixel hinting is, however, already
available in freetype 2.5 and in versions having the "Infinality"
patch.
To get the expected results in all environments, we have to disable
subpixel hinting, what is easily done by setting a respective
environment variable.
See also:
* https://www.freetype.org/freetype2/docs/subpixel-hinting.html
* https://www.freetype.org/freetype2/docs/reference/ft2-tt_driver.html
---
tests/freetype/bug00132.c | 3 +++
tests/gdimagestringft/gdimagestringft_bbox.c | 3 +++
2 files changed, 6 insertions(+)
diff --git a/tests/freetype/bug00132.c b/tests/freetype/bug00132.c
index 713dd2d0..42ed5b17 100644
--- a/tests/freetype/bug00132.c
+++ b/tests/freetype/bug00132.c
@@ -11,6 +11,9 @@ int main()
char *path;
char *ret = NULL;
+ /* disable subpixel hinting */
+ putenv("FREETYPE_PROPERTIES=truetype:interpreter-version=35");
+
im = gdImageCreateTrueColor(50, 30);
if (!im) {
diff --git a/tests/gdimagestringft/gdimagestringft_bbox.c b/tests/gdimagestringft/gdimagestringft_bbox.c
index 0161ec81..1596a9e7 100644
--- a/tests/gdimagestringft/gdimagestringft_bbox.c
+++ b/tests/gdimagestringft/gdimagestringft_bbox.c
@@ -38,6 +38,9 @@ int main()
int error = 0;
FILE *fp;
+ /* disable subpixel hinting */
+ putenv("FREETYPE_PROPERTIES=truetype:interpreter-version=35");
+
path = gdTestFilePath("freetype/DejaVuSans.ttf");
im = gdImageCreate(800, 800);
gdImageColorAllocate(im, 0xFF, 0xFF, 0xFF); /* allocate white for background color */