shithub: dav1d

Download patch

ref: b716083c7a5a689072cb8f61fc70e31546e8e45e
parent: 1b536ad41bfab7ac0a2713c51fd0ce1bc543859e
author: Janne Grunau <janne-vlc@jannau.net>
date: Mon Nov 19 15:13:02 EST 2018

fuzzer: mask all CPU flags under memory sanitizer

--- a/tests/libfuzzer/dav1d_fuzzer.c
+++ b/tests/libfuzzer/dav1d_fuzzer.c
@@ -31,6 +31,7 @@
 #include <string.h>
 
 #include <dav1d/dav1d.h>
+#include "src/cpu.h"
 #include "dav1d_fuzzer.h"
 
 static unsigned r32le(const uint8_t *const p) {
@@ -61,6 +62,13 @@
     int err;
 
     dav1d_version();
+
+    // memory sanitizer is inherently incompatible with asm
+#if defined(__has_feature)
+  #if __has_feature(memory_sanitizer)
+    dav1d_set_cpu_flags_mask(0);
+  #endif
+#endif
 
     if (size < 32) goto end;
     ptr += 32; // skip ivf header