Commit f1d4dd2bd0 for ffmpeg
commit f1d4dd2bd0ace9263b590b1f3a500190b8687bef
Author: Zhao Zhili <quinkblack@foxmail.com>
Date: Tue Nov 17 15:58:28 2026 +0800
avcodec/x86/cabac: fix build with AddressSanitizer
Sanitizer builds are compiled with -fno-omit-frame-pointer. Together
with AddressSanitizer's instrumentation of the locals, this leaves too
few general-purpose registers on x86-64 for the operand constraints of
decode_significance_x86 and decode_significance_8x8_x86 in unoptimized
builds, and the compiler rejects the inline assembly.
Inline assembly is not instrumented, so it brings no sanitizer coverage.
Use the C implementation of the significance decoders in sanitizer
builds instead.
Regression since cd8d538fe7
diff --git a/libavcodec/x86/h264_cabac.c b/libavcodec/x86/h264_cabac.c
index 734879dbd6..bf7928ab29 100644
--- a/libavcodec/x86/h264_cabac.c
+++ b/libavcodec/x86/h264_cabac.c
@@ -29,6 +29,7 @@
#include <stddef.h>
#include "libavcodec/cabac.h"
+#include "libavutil/sanitizer.h"
#include "cabac.h"
#if HAVE_INLINE_ASM
@@ -41,7 +42,7 @@
//FIXME use some macros to avoid duplicating get_cabac (cannot be done yet
//as that would make optimization work hard)
-#if HAVE_X86_7REGS && !BROKEN_COMPILER
+#if HAVE_X86_7REGS && !BROKEN_COMPILER && !HAVE_ASAN
#define decode_significance decode_significance_x86
static int decode_significance_x86(CABACContext *c, int max_coeff,
uint8_t *significant_coeff_ctx_base,