diff --git a/test/c/std/gif.c b/test/c/std/gif.c index dbd0284c..453e6b57 100644 --- a/test/c/std/gif.c +++ b/test/c/std/gif.c @@ -1019,6 +1019,23 @@ const char* test_wuffs_gif_decode_multiple_loop_counts() { return NULL; } +const char* test_wuffs_gif_decode_pixel_data_none() { + CHECK_FOCUS(__func__); + + wuffs_base__io_buffer src = ((wuffs_base__io_buffer){ + .data = global_src_slice, + }); + + const char* status = + read_file(&src, "test/data/artificial/gif-pixel-data-none.gif"); + if (status) { + return status; + } + + return do_test_wuffs_gif_decode_expecting( + src, wuffs_base__error__not_enough_data, true); +} + const char* test_wuffs_gif_decode_not_enough_data() { CHECK_FOCUS(__func__); @@ -1669,6 +1686,7 @@ proc tests[] = { test_wuffs_gif_decode_input_is_a_png, // test_wuffs_gif_decode_missing_two_src_bytes, // test_wuffs_gif_decode_multiple_loop_counts, // + test_wuffs_gif_decode_pixel_data_none, // test_wuffs_gif_decode_not_enough_data, // test_wuffs_gif_decode_too_much_data, // test_wuffs_gif_frame_dirty_rect, // diff --git a/test/data/artificial/gif-pixel-data-none.gif b/test/data/artificial/gif-pixel-data-none.gif new file mode 100644 index 00000000..0227f9d2 Binary files /dev/null and b/test/data/artificial/gif-pixel-data-none.gif differ diff --git a/test/data/artificial/gif-pixel-data-none.gif.make-artificial.txt b/test/data/artificial/gif-pixel-data-none.gif.make-artificial.txt new file mode 100644 index 00000000..9dc0eef1 --- /dev/null +++ b/test/data/artificial/gif-pixel-data-none.gif.make-artificial.txt @@ -0,0 +1,23 @@ +# Feed this file to script/make-artificial.go + +make gif + +header + +image { + imageWidthHeight 2 2 + palette { + 0x00 0x00 0xFF + 0x11 0x00 0xFF + 0x22 0x00 0xFF + 0x33 0x00 0xFF + } +} + +frame { + frameLeftTopWidthHeight 0 0 2 2 +} +# The frame is 4 pixels, but we don't supply any. +lzw 2 + +trailer