File gdk-pixbuf-bsc1053417-test-fix.patch of Package gdk-pixbuf.40368

From 86fedf6383d025685edb5bc1dfa45e0420232cb0 Mon Sep 17 00:00:00 2001
From: Bastien Nocera <hadess@hadess.net>
Date: Wed, 26 Jul 2017 16:36:58 +0200
Subject: [PATCH] tests: Fix CVE-2015-4491 test

The sanity checks for image dimensions have since been tightened in
commit 4154d4f and we should not be able to open this huge image anymore
as the dimensions exceed what's possible.
---
 tests/cve-2015-4491.c | 8 ++------
 1 file changed, 2 insertions(+), 6 deletions(-)

diff --git a/tests/cve-2015-4491.c b/tests/cve-2015-4491.c
index 988cb495d..f5454d0a7 100644
--- a/tests/cve-2015-4491.c
+++ b/tests/cve-2015-4491.c
@@ -30,12 +30,8 @@ test_original (void)
   GError* err = NULL;
 
   buf = gdk_pixbuf_new_from_resource_at_scale ("/test/resource/cve-2015-4491.bmp", size, size, FALSE, &err);
-  if (skip_if_insufficient_memory (&err))
-    return;
-
-  g_assert_no_error (err);
-
-  g_object_unref (buf);
+  /* Image is corrupt because the rowstride * height mul overflows */
+  g_assert_error (err, GDK_PIXBUF_ERROR, GDK_PIXBUF_ERROR_CORRUPT_IMAGE);
 }
 
 static void
-- 
2.18.0

openSUSE Build Service is sponsored by