summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorBastien Nocera <hadess@hadess.net>2016-12-16 16:17:42 +0100
committerBastien Nocera <hadess@hadess.net>2016-12-16 16:38:07 +0100
commit28fbde8f87385c699f5693d95c07076cac204baa (patch)
treeaf5fe82b11d2964a2b0b7ce2b64a6fcfc19ddc87 /tests
parentdaaae1b9b8c47be4789191af10dda0004bd4da90 (diff)
downloadgdk-pixbuf-28fbde8f87385c699f5693d95c07076cac204baa.tar.gz
tests: Fix bug in pixdata test
In 3724a739 we added a test for the deserializing code, but we shouldn't be free'ing the contents straight away, as gdk_pixdata_deserialize() does not copy the data, but expects it to stay around until we've copied the data to the pixbuf (with gdk_pixbuf_from_pixdata() and copy_pixels == TRUE), or we're done with the pixbuf. https://bugzilla.gnome.org/show_bug.cgi?id=775693
Diffstat (limited to 'tests')
-rw-r--r--tests/pixbuf-pixdata.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/tests/pixbuf-pixdata.c b/tests/pixbuf-pixdata.c
index a81e41cac..874644056 100644
--- a/tests/pixbuf-pixdata.c
+++ b/tests/pixbuf-pixdata.c
@@ -41,11 +41,11 @@ test_pixdata_deserialize (gconstpointer data)
gdk_pixdata_deserialize (&pixdata, size, (const guint8 *) contents, &error);
g_assert_no_error (error);
- g_free (contents);
pixbuf = gdk_pixbuf_from_pixdata (&pixdata, TRUE, &error);
g_assert_error (error, GDK_PIXBUF_ERROR, GDK_PIXBUF_ERROR_CORRUPT_IMAGE);
g_clear_error (&error);
+ g_free (contents);
pixbuf = gdk_pixbuf_from_pixdata (&pixdata, FALSE, &error);
g_assert_error (error, GDK_PIXBUF_ERROR, GDK_PIXBUF_ERROR_CORRUPT_IMAGE);