Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(17)

Unified Diff: third_party/qcms/src/transform.c

Issue 2815303003: [qcms] Disable advisory asserts when running in libfuzzer (Closed)
Patch Set: Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « third_party/qcms/src/iccread.c ('k') | third_party/qcms/src/transform_util.c » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/qcms/src/transform.c
diff --git a/third_party/qcms/src/transform.c b/third_party/qcms/src/transform.c
index dd4eee46ec05e12a7dd50fcc4fc957662ed565d2..b20a39c54618e30f021ff767025a1ffa2e308adb 100644
--- a/third_party/qcms/src/transform.c
+++ b/third_party/qcms/src/transform.c
@@ -31,6 +31,12 @@
#include "matrix.h"
#include "transform_util.h"
+#ifdef USE_LIBFUZZER
+#define ASSERT(x)
+#else
+#define ASSERT(x) assert(x)
+#endif
+
/* for MSVC, GCC, Intel, and Sun compilers */
#if defined(_M_IX86) || defined(__i386__) || defined(__i386) || defined(_M_AMD64) || defined(__x86_64__) || defined(__x86_64)
#define X86
@@ -1296,7 +1302,7 @@ qcms_transform* qcms_transform_create(
}
if (out_type != QCMS_DATA_RGB_8 && out_type != QCMS_DATA_RGBA_8) {
- assert(0 && "output type");
+ ASSERT(0 && "output type");
qcms_transform_release(transform);
return NULL;
}
@@ -1315,7 +1321,7 @@ qcms_transform* qcms_transform_create(
// precaching should be avoided.
qcms_transform *result = qcms_transform_precacheLUT_float(transform, in, out, 33, in_type);
if (!result) {
- assert(0 && "precacheLUT failed");
+ ASSERT(0 && "precacheLUT failed");
qcms_transform_release(transform);
return NULL;
}
@@ -1353,7 +1359,7 @@ qcms_transform* qcms_transform_create(
struct matrix in_matrix, out_matrix, result;
if (in_type != QCMS_DATA_RGB_8 && in_type != QCMS_DATA_RGBA_8) {
- assert(0 && "input type");
+ ASSERT(0 && "input type");
qcms_transform_release(transform);
return NULL;
}
@@ -1428,7 +1434,7 @@ qcms_transform* qcms_transform_create(
} else if (in->color_space == GRAY_SIGNATURE) {
if (in_type != QCMS_DATA_GRAY_8 && in_type != QCMS_DATA_GRAYA_8) {
- assert(0 && "input type");
+ ASSERT(0 && "input type");
qcms_transform_release(transform);
return NULL;
}
@@ -1454,7 +1460,7 @@ qcms_transform* qcms_transform_create(
}
}
} else {
- assert(0 && "unexpected colorspace");
+ ASSERT(0 && "unexpected colorspace");
qcms_transform_release(transform);
return NULL;
}
@@ -1567,7 +1573,7 @@ size_t qcms_transform_get_input_trc_rgba(qcms_transform *t, qcms_profile *in, qc
break;
default:
/* should not be reached */
- assert(0);
+ ASSERT(0);
}
return size;
@@ -1634,7 +1640,7 @@ size_t qcms_transform_get_output_trc_rgba(qcms_transform *t, qcms_profile *out,
break;
default:
/* should not be reached */
- assert(0);
+ ASSERT(0);
}
return size;
« no previous file with comments | « third_party/qcms/src/iccread.c ('k') | third_party/qcms/src/transform_util.c » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698