OSS-Fuzz: Test non-default opts w/ decompress_yuv
The non-default options were not being tested because of a pixel format
comparison buglet. This commit also changes the code in both
decompression fuzz targets such that non-default options are tested
based on the pixel format index rather than the pixel format value,
which is a bit more idiot-proof.
diff --git a/fuzz/decompress.cc b/fuzz/decompress.cc
index bad3252..022336a 100644
--- a/fuzz/decompress.cc
+++ b/fuzz/decompress.cc
@@ -71,10 +71,10 @@
int w = width, h = height;
/* Test non-default decompression options on the first iteration. */
- if (pf == TJPF_RGB)
+ if (pfi == 0)
flags |= TJFLAG_BOTTOMUP | TJFLAG_FASTUPSAMPLE | TJFLAG_FASTDCT;
/* Test IDCT scaling on the second iteration. */
- if (pf == TJPF_BGRX) {
+ else if (pfi == 1) {
w = (width + 1) / 2;
h = (height + 1) / 2;
}
diff --git a/fuzz/decompress_yuv.cc b/fuzz/decompress_yuv.cc
index dc4620c..a8a7302 100644
--- a/fuzz/decompress_yuv.cc
+++ b/fuzz/decompress_yuv.cc
@@ -68,10 +68,10 @@
int w = width, h = height;
/* Test non-default decompression options on the first iteration. */
- if (pf == TJPF_RGB)
+ if (pfi == 0)
flags |= TJFLAG_BOTTOMUP | TJFLAG_FASTUPSAMPLE | TJFLAG_FASTDCT;
/* Test IDCT scaling on the second iteration. */
- if (pf == TJPF_XRGB) {
+ else if (pfi == 1) {
w = (width + 3) / 4;
h = (height + 3) / 4;
}