[gdk-pixbuf/ebassi/issue-215] Check the right error code on 32bit architectures




commit 16c4e53ca14af70dffb2ce0eb3b9628f5689e8e4
Author: Emmanuele Bassi <ebassi gnome org>
Date:   Tue Aug 9 23:20:13 2022 +0100

    Check the right error code on 32bit architectures
    
    The test for #205 will trigger an OOM error on 32 bit architectures,
    since we're trying to allocate a buffer with a size that is larger than
    2**32-1 bytes.
    
    Fixes: #215

 tests/pixbuf-jpeg.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)
---
diff --git a/tests/pixbuf-jpeg.c b/tests/pixbuf-jpeg.c
index be2c6b4fe..b3648bf06 100644
--- a/tests/pixbuf-jpeg.c
+++ b/tests/pixbuf-jpeg.c
@@ -185,7 +185,7 @@ test_jpeg_fbfbfbfb (void)
       return;
     }
 
-  g_test_message ("Load JPEG with size 0xfbfbfbfb (issue: 250)");
+  g_test_message ("Load JPEG with size 0xfbfbfbfb (issue: 205)");
 
   g_file_get_contents (g_test_get_filename (G_TEST_DIST, "issue205.jpg", NULL), &contents, &size, &error);
   g_assert_no_error (error);
@@ -196,7 +196,12 @@ test_jpeg_fbfbfbfb (void)
   g_assert_no_error (error);
 
   gdk_pixbuf_loader_close (loader, &error);
+
+#if GLIB_SIZEOF_VOID_P == 8
   g_assert_error (error, GDK_PIXBUF_ERROR, GDK_PIXBUF_ERROR_CORRUPT_IMAGE);
+#else
+  g_assert_error (error, GDK_PIXBUF_ERROR, GDK_PIXBUF_ERROR_INSUFFICIENT_MEMORY);
+#endif
 
   pixbuf = gdk_pixbuf_loader_get_pixbuf (loader);
   g_assert_nonnull (pixbuf);


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]