Have gif_fuzzer sometimes use a BGRA_PREMUL dst
diff --git a/fuzz/c/std/gif_fuzzer.c b/fuzz/c/std/gif_fuzzer.c
index 5c483f8..e8950a4 100644
--- a/fuzz/c/std/gif_fuzzer.c
+++ b/fuzz/c/std/gif_fuzzer.c
@@ -74,6 +74,7 @@
&dec, sizeof dec, WUFFS_VERSION,
(hash & 1) ? WUFFS_INITIALIZE__LEAVE_INTERNAL_BUFFERS_UNINITIALIZED
: 0);
+ hash >>= 1;
if (!wuffs_base__status__is_ok(&status)) {
ret = wuffs_base__status__message(&status);
goto exit;
@@ -90,6 +91,16 @@
goto exit;
}
+ // 50% of the time, choose BGRA_PREMUL instead of the native pixel config.
+ if (hash & 1) {
+ wuffs_base__pixel_config__set(
+ &ic.pixcfg, WUFFS_BASE__PIXEL_FORMAT__BGRA_PREMUL,
+ WUFFS_BASE__PIXEL_SUBSAMPLING__NONE,
+ wuffs_base__pixel_config__width(&ic.pixcfg),
+ wuffs_base__pixel_config__height(&ic.pixcfg));
+ }
+ hash >>= 1;
+
// Wuffs allows either statically or dynamically allocated work buffers.
// This program exercises dynamic allocation.
uint64_t n = wuffs_gif__decoder__workbuf_len(&dec).max_incl;