diff options
| -rw-r--r-- | mupdf.zig | 8 |
1 files changed, 7 insertions, 1 deletions
@@ -98,13 +98,19 @@ pub fn add(b: *std.Build, io: std.Io, dependency: *std.Build.Dependency, options module.addCSourceFiles(.{ .root = dependency.path(""), .files = makeSources(b, makelists, "LIBJPEG_SRC"), - .flags = &.{"-std=gnu11"}, + // libjpeg calls back into source/fitz (filter-dct.c's source + // manager), which is built without UBSan: -fsanitize=function at + // such a call finds no type hash on the callee and traps, so any + // PDF with a DCT image crashed ReleaseSafe and Debug builds in + // jpeg_fill_bit_buffer. The same holds for jbig2dec below. + .flags = &.{ "-std=gnu11", "-fno-sanitize=undefined" }, }); module.addCSourceFiles(.{ .root = dependency.path(""), .files = makeSources(b, makelists, "JBIG2DEC_SRC"), .flags = &.{ "-std=gnu11", + "-fno-sanitize=undefined", "-DHAVE_STDINT_H", "-DJBIG_EXTERNAL_MEMENTO_H=\"mupdf/memento.h\"", }, |
