mirror of
https://github.com/libjpeg-turbo/libjpeg-turbo.git
synced 2026-01-18 21:41:20 +01:00
Fuzz: Comment wordsmithing
This commit is contained in:
@@ -102,7 +102,7 @@ extern "C" int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size)
|
||||
tj3Set(handle, TJPARAM_QUALITY, tests[ti].quality);
|
||||
if (tj3Compress8(handle, srcBuf, width, 0, height, pf, &dstBuf,
|
||||
&dstSize) == 0) {
|
||||
/* Touch all of the output pixels in order to catch uninitialized reads
|
||||
/* Touch all of the output data in order to catch uninitialized reads
|
||||
when using MemorySanitizer. */
|
||||
for (i = 0; i < dstSize; i++)
|
||||
sum += dstBuf[i];
|
||||
@@ -113,7 +113,7 @@ extern "C" int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size)
|
||||
tj3Free(srcBuf);
|
||||
srcBuf = NULL;
|
||||
|
||||
/* Prevent the code above from being optimized out. This test should never
|
||||
/* Prevent the sum above from being optimized out. This test should never
|
||||
be true, but the compiler doesn't know that. */
|
||||
if (sum > 255 * maxBufSize)
|
||||
goto bailout;
|
||||
|
||||
@@ -102,7 +102,7 @@ extern "C" int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size)
|
||||
tj3Set(handle, TJPARAM_QUALITY, tests[ti].quality);
|
||||
if (tj3Compress12(handle, srcBuf, width, 0, height, pf, &dstBuf,
|
||||
&dstSize) == 0) {
|
||||
/* Touch all of the output pixels in order to catch uninitialized reads
|
||||
/* Touch all of the output data in order to catch uninitialized reads
|
||||
when using MemorySanitizer. */
|
||||
for (i = 0; i < dstSize; i++)
|
||||
sum += dstBuf[i];
|
||||
@@ -113,7 +113,7 @@ extern "C" int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size)
|
||||
tj3Free(srcBuf);
|
||||
srcBuf = NULL;
|
||||
|
||||
/* Prevent the code above from being optimized out. This test should never
|
||||
/* Prevent the sum above from being optimized out. This test should never
|
||||
be true, but the compiler doesn't know that. */
|
||||
if (sum > 255 * maxBufSize)
|
||||
goto bailout;
|
||||
|
||||
@@ -100,7 +100,7 @@ extern "C" int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size)
|
||||
tj3Set(handle, TJPARAM_LOSSLESSPT, tests[ti].pt);
|
||||
if (tj3Compress12(handle, srcBuf, width, 0, height, pf, &dstBuf,
|
||||
&dstSize) == 0) {
|
||||
/* Touch all of the output pixels in order to catch uninitialized reads
|
||||
/* Touch all of the output data in order to catch uninitialized reads
|
||||
when using MemorySanitizer. */
|
||||
for (i = 0; i < dstSize; i++)
|
||||
sum += dstBuf[i];
|
||||
@@ -111,7 +111,7 @@ extern "C" int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size)
|
||||
tj3Free(srcBuf);
|
||||
srcBuf = NULL;
|
||||
|
||||
/* Prevent the code above from being optimized out. This test should never
|
||||
/* Prevent the sum above from being optimized out. This test should never
|
||||
be true, but the compiler doesn't know that. */
|
||||
if (sum > 255 * maxBufSize)
|
||||
goto bailout;
|
||||
|
||||
@@ -100,7 +100,7 @@ extern "C" int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size)
|
||||
tj3Set(handle, TJPARAM_LOSSLESSPT, tests[ti].pt);
|
||||
if (tj3Compress16(handle, srcBuf, width, 0, height, pf, &dstBuf,
|
||||
&dstSize) == 0) {
|
||||
/* Touch all of the output pixels in order to catch uninitialized reads
|
||||
/* Touch all of the output data in order to catch uninitialized reads
|
||||
when using MemorySanitizer. */
|
||||
for (i = 0; i < dstSize; i++)
|
||||
sum += dstBuf[i];
|
||||
@@ -111,7 +111,7 @@ extern "C" int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size)
|
||||
tj3Free(srcBuf);
|
||||
srcBuf = NULL;
|
||||
|
||||
/* Prevent the code above from being optimized out. This test should never
|
||||
/* Prevent the sum above from being optimized out. This test should never
|
||||
be true, but the compiler doesn't know that. */
|
||||
if (sum > 255 * maxBufSize)
|
||||
goto bailout;
|
||||
|
||||
@@ -99,7 +99,7 @@ extern "C" int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size)
|
||||
tj3Set(handle, TJPARAM_LOSSLESSPT, tests[ti].pt);
|
||||
if (tj3Compress8(handle, srcBuf, width, 0, height, pf, &dstBuf,
|
||||
&dstSize) == 0) {
|
||||
/* Touch all of the output pixels in order to catch uninitialized reads
|
||||
/* Touch all of the output data in order to catch uninitialized reads
|
||||
when using MemorySanitizer. */
|
||||
for (i = 0; i < dstSize; i++)
|
||||
sum += dstBuf[i];
|
||||
@@ -110,7 +110,7 @@ extern "C" int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size)
|
||||
tj3Free(srcBuf);
|
||||
srcBuf = NULL;
|
||||
|
||||
/* Prevent the code above from being optimized out. This test should never
|
||||
/* Prevent the sum above from being optimized out. This test should never
|
||||
be true, but the compiler doesn't know that. */
|
||||
if (sum > 255 * maxBufSize)
|
||||
goto bailout;
|
||||
|
||||
@@ -103,7 +103,7 @@ extern "C" int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size)
|
||||
if (tj3EncodeYUV8(handle, srcBuf, width, 0, height, pf, yuvBuf, 1) == 0 &&
|
||||
tj3CompressFromYUV8(handle, yuvBuf, width, 1, height, &dstBuf,
|
||||
&dstSize) == 0) {
|
||||
/* Touch all of the output pixels in order to catch uninitialized reads
|
||||
/* Touch all of the output data in order to catch uninitialized reads
|
||||
when using MemorySanitizer. */
|
||||
for (i = 0; i < dstSize; i++)
|
||||
sum += dstBuf[i];
|
||||
@@ -117,7 +117,7 @@ extern "C" int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size)
|
||||
tj3Free(srcBuf);
|
||||
srcBuf = NULL;
|
||||
|
||||
/* Prevent the code above from being optimized out. This test should never
|
||||
/* Prevent the sum above from being optimized out. This test should never
|
||||
be true, but the compiler doesn't know that. */
|
||||
if (sum > 255 * maxBufSize)
|
||||
goto bailout;
|
||||
|
||||
@@ -129,7 +129,7 @@ extern "C" int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size)
|
||||
free(dstBuf);
|
||||
dstBuf = NULL;
|
||||
|
||||
/* Prevent the code above from being optimized out. This test should never
|
||||
/* Prevent the sum above from being optimized out. This test should never
|
||||
be true, but the compiler doesn't know that. */
|
||||
if (sum > ((1LL << precision) - 1LL) * 1048576LL * tjPixelSize[pf])
|
||||
goto bailout;
|
||||
|
||||
@@ -103,7 +103,7 @@ extern "C" int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size)
|
||||
free(yuvBuf);
|
||||
yuvBuf = NULL;
|
||||
|
||||
/* Prevent the code above from being optimized out. This test should never
|
||||
/* Prevent the sum above from being optimized out. This test should never
|
||||
be true, but the compiler doesn't know that. */
|
||||
if (sum > 255 * 1048576 * tjPixelSize[pf])
|
||||
goto bailout;
|
||||
|
||||
@@ -77,15 +77,15 @@ extern "C" int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size)
|
||||
tj3Set(handle, TJPARAM_NOREALLOC, 1);
|
||||
if (tj3Transform(handle, data, size, 1, dstBufs, dstSizes,
|
||||
transforms) == 0) {
|
||||
/* Touch all of the output pixels in order to catch uninitialized reads
|
||||
when using MemorySanitizer. */
|
||||
/* Touch all of the output data in order to catch uninitialized reads when
|
||||
using MemorySanitizer. */
|
||||
size_t sum = 0;
|
||||
|
||||
for (i = 0; i < dstSizes[0]; i++)
|
||||
sum += dstBufs[0][i];
|
||||
|
||||
/* Prevent the code above from being optimized out. This test should
|
||||
never be true, but the compiler doesn't know that. */
|
||||
/* Prevent the sum above from being optimized out. This test should never
|
||||
be true, but the compiler doesn't know that. */
|
||||
if (sum > 255 * maxBufSize)
|
||||
goto bailout;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user