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.
This commit is contained in:
@@ -71,10 +71,10 @@ extern "C" int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size)
|
|||||||
int w = width, h = height;
|
int w = width, h = height;
|
||||||
|
|
||||||
/* Test non-default decompression options on the first iteration. */
|
/* Test non-default decompression options on the first iteration. */
|
||||||
if (pf == TJPF_RGB)
|
if (pfi == 0)
|
||||||
flags |= TJFLAG_BOTTOMUP | TJFLAG_FASTUPSAMPLE | TJFLAG_FASTDCT;
|
flags |= TJFLAG_BOTTOMUP | TJFLAG_FASTUPSAMPLE | TJFLAG_FASTDCT;
|
||||||
/* Test IDCT scaling on the second iteration. */
|
/* Test IDCT scaling on the second iteration. */
|
||||||
if (pf == TJPF_BGRX) {
|
else if (pfi == 1) {
|
||||||
w = (width + 1) / 2;
|
w = (width + 1) / 2;
|
||||||
h = (height + 1) / 2;
|
h = (height + 1) / 2;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -68,10 +68,10 @@ extern "C" int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size)
|
|||||||
int w = width, h = height;
|
int w = width, h = height;
|
||||||
|
|
||||||
/* Test non-default decompression options on the first iteration. */
|
/* Test non-default decompression options on the first iteration. */
|
||||||
if (pf == TJPF_RGB)
|
if (pfi == 0)
|
||||||
flags |= TJFLAG_BOTTOMUP | TJFLAG_FASTUPSAMPLE | TJFLAG_FASTDCT;
|
flags |= TJFLAG_BOTTOMUP | TJFLAG_FASTUPSAMPLE | TJFLAG_FASTDCT;
|
||||||
/* Test IDCT scaling on the second iteration. */
|
/* Test IDCT scaling on the second iteration. */
|
||||||
if (pf == TJPF_XRGB) {
|
else if (pfi == 1) {
|
||||||
w = (width + 3) / 4;
|
w = (width + 3) / 4;
|
||||||
h = (height + 3) / 4;
|
h = (height + 3) / 4;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user