mirror of
https://github.com/ddidderr/wuffs.git
synced 2026-11-17 16:32:11 +01:00
Have gif_fuzzer sometimes use a BGRA_PREMUL dst
This commit is contained in:
1 parent
0f807639c1
commit
bb7390261a
1 file changed
+11
@@ -74,6 +74,7 @@ fuzz(wuffs_base__io_buffer* src, uint64_t hash) {
|
||||
&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 @@ fuzz(wuffs_base__io_buffer* src, uint64_t hash) {
|
||||
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;
|
||||
|
||||
Reference in new issue
Block a user