From 688efad6e96d755188cb08fbe9e16822e1cfa3f1 Mon Sep 17 00:00:00 2001 From: Brad Smith Date: Thu, 1 Oct 2026 14:55:32 -0400 Subject: [PATCH] CPU: Check elf_aux_info return value in x265_getauxval elf_aux_info() returns an errno value (0 on success) rather than -1 with errno set. Check the result and return 0 ("no features reported") on failure instead of silently ignoring the error. --- source/common/cpu.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/source/common/cpu.cpp b/source/common/cpu.cpp index 3022ae44e..4f29481b6 100644 --- a/source/common/cpu.cpp +++ b/source/common/cpu.cpp @@ -148,8 +148,9 @@ unsigned long x265_getauxval(unsigned long type) #if HAVE_GETAUXVAL return getauxval(type); #elif HAVE_ELF_AUX_INFO - unsigned long aux = 0; - elf_aux_info(type, &aux, sizeof(aux)); + unsigned long aux; + if (elf_aux_info(type, &aux, sizeof(aux)) != 0) + aux = 0; return aux; #else (void)type;