changeset 9605:6c70bf1d3c90

primitives: ensure x265_cpu_cpuid() clears eax even when built without asm valgrind found this error condition; when built without assembly cpu detection was using an uninitialized variable.
author Steve Borho <steve@borho.org>
date Wed, 04 Mar 2015 07:20:07 -0600
parents affaf2561104
children 058cbd563b8f
files source/common/primitives.cpp
diffstat 1 files changed, 1 insertions(+-), 1 deletions(-) [+]
line wrap: on
line diff
--- a/source/common/primitives.cpp	Wed Mar 04 07:11:02 2015 -0600
+++ b/source/common/primitives.cpp	Wed Mar 04 07:20:07 2015 -0600
@@ -258,7 +258,7 @@ void x265_setup_primitives(x265_param *p
 extern "C" {
 int x265_cpu_cpuid_test(void) { return 0; }
 void x265_cpu_emms(void) {}
-void x265_cpu_cpuid(uint32_t, uint32_t *, uint32_t *, uint32_t *, uint32_t *) {}
+void x265_cpu_cpuid(uint32_t, uint32_t *eax, uint32_t *, uint32_t *, uint32_t *) { *eax = 0; }
 void x265_cpu_xgetbv(uint32_t, uint32_t *, uint32_t *) {}
 }
 #endif