Fix unsigned int overflow reported by UBSan (#761)
[openjpeg.git] / src / lib / openjp2 / opj_includes.h
index 5add09188e958419af326391d79508e6366f6ddc..58a5a9a9ac070eca5c6d4ca901b20718ad9fc0d7 100644 (file)
        #endif
 #endif
 
+#ifdef __has_attribute
+       #if __has_attribute(no_sanitize)
+               #define OPJ_NOSANITIZE(kind) __attribute__((no_sanitize(kind)))
+       #endif
+#endif
+#ifndef OPJ_NOSANITIZE
+       #define OPJ_NOSANITIZE(kind)
+#endif
 
 
 /* MSVC before 2013 and Borland C do not have lrintf */