diff options
Diffstat (limited to 'tests/pixbuf-jpeg.c')
-rw-r--r-- | tests/pixbuf-jpeg.c | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/tests/pixbuf-jpeg.c b/tests/pixbuf-jpeg.c index 3b1f2e4f0..be2c6b4fe 100644 --- a/tests/pixbuf-jpeg.c +++ b/tests/pixbuf-jpeg.c @@ -170,6 +170,41 @@ test_jpeg_markers (void) g_free (contents); } +static void +test_jpeg_fbfbfbfb (void) +{ + GdkPixbufLoader *loader; + GdkPixbuf *pixbuf; + GError *error = NULL; + gchar *contents; + gsize size; + + if (!format_supported ("jpeg")) + { + g_test_skip ("format not supported"); + return; + } + + g_test_message ("Load JPEG with size 0xfbfbfbfb (issue: 250)"); + + g_file_get_contents (g_test_get_filename (G_TEST_DIST, "issue205.jpg", NULL), &contents, &size, &error); + g_assert_no_error (error); + + loader = gdk_pixbuf_loader_new (); + + gdk_pixbuf_loader_write (loader, (const guchar*)contents, size, &error); + g_assert_no_error (error); + + gdk_pixbuf_loader_close (loader, &error); + g_assert_error (error, GDK_PIXBUF_ERROR, GDK_PIXBUF_ERROR_CORRUPT_IMAGE); + + pixbuf = gdk_pixbuf_loader_get_pixbuf (loader); + g_assert_nonnull (pixbuf); + + g_object_unref (loader); + g_free (contents); +} + int main (int argc, char **argv) { @@ -181,6 +216,7 @@ main (int argc, char **argv) g_test_add_func ("/pixbuf/jpeg/comment", test_comment); g_test_add_func ("/pixbuf/jpeg/at_size", test_at_size); g_test_add_func ("/pixbuf/jpeg/issue70", test_jpeg_markers); + g_test_add_func ("/pixbuf/jpeg/issue205", test_jpeg_fbfbfbfb); return g_test_run (); } |