Ensure random colorization always changes byte

This commit is contained in:
guyf2010
2022-11-14 12:19:44 +00:00
parent 189255d3f4
commit 7f7cbe9623

View File

@ -172,7 +172,15 @@ static void random_replace(afl_state_t *afl, u8 *buf, u32 len) {
for (u32 i = 0; i < len; i++) {
buf[i] = rand_below(afl, 256);
u8 c;
do {
c = rand_below(afl, 256);
} while (c == buf[i]);
buf[i] = c;
}