diff options
author | Tobias Mueller <muelli@cryptobitch.de> | 2016-12-12 16:17:04 +0100 |
---|---|---|
committer | Bastien Nocera <hadess@hadess.net> | 2016-12-13 12:17:38 +0100 |
commit | 7fc0cc2cc8809bbec3cf80e655c40944f6760698 (patch) | |
tree | 70d030ead7b78fe190553b7a34ebacd2fdc47a5c /tests | |
parent | 5daadc0b44092ba53797b2629490e5ea223647f5 (diff) | |
download | gdk-pixbuf-7fc0cc2cc8809bbec3cf80e655c40944f6760698.tar.gz |
tests: Add test case for bug 775218
https://bugzilla.gnome.org/show_bug.cgi?id=775218
Diffstat (limited to 'tests')
-rw-r--r-- | tests/Makefile.am | 1 | ||||
-rw-r--r-- | tests/bug775218.jpg | bin | 0 -> 8344 bytes | |||
-rw-r--r-- | tests/pixbuf-jpeg.c | 18 |
3 files changed, 19 insertions, 0 deletions
diff --git a/tests/Makefile.am b/tests/Makefile.am index c765382d2..40c347740 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -59,6 +59,7 @@ dist_installed_test_data = \ cve-2015-4491.bmp \ large.png \ large.jpg \ + bug775218.jpg \ $(wildcard $(srcdir)/test-images/fail/*) \ $(wildcard $(srcdir)/test-images/randomly-modified/*) \ $(wildcard $(srcdir)/test-images/reftests/*.*) \ diff --git a/tests/bug775218.jpg b/tests/bug775218.jpg Binary files differnew file mode 100644 index 000000000..510a44293 --- /dev/null +++ b/tests/bug775218.jpg diff --git a/tests/pixbuf-jpeg.c b/tests/pixbuf-jpeg.c index 351fa204f..073104a32 100644 --- a/tests/pixbuf-jpeg.c +++ b/tests/pixbuf-jpeg.c @@ -79,6 +79,23 @@ test_type9_rotation_exif_tag (void) g_object_unref (ref); } +static void +test_bug_775218 (void) +{ + GError *error = NULL; + GdkPixbuf *ref; + + if (!format_supported ("jpeg")) + { + g_test_skip ("format not supported"); + return; + } + + ref = gdk_pixbuf_new_from_file (g_test_get_filename (G_TEST_DIST, "bug775218.jpg", NULL), &error); + g_assert_error (error, GDK_PIXBUF_ERROR, GDK_PIXBUF_ERROR_CORRUPT_IMAGE); + g_clear_object (&ref); +} + int main (int argc, char **argv) { @@ -86,6 +103,7 @@ main (int argc, char **argv) g_test_add_func ("/pixbuf/jpeg/inverted_cmyk_jpeg", test_inverted_cmyk_jpeg); g_test_add_func ("/pixbuf/jpeg/type9_rotation_exif_tag", test_type9_rotation_exif_tag); + g_test_add_func ("/pixbuf/jpeg/bug775218", test_bug_775218); return g_test_run (); } |