From bc8bcf27e0654ca9174c876f9f28b5f39c5cc1e0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ahmet=20Kaan=20G=C3=BCm=C3=BC=C5=9F?= Date: Wed, 2 Dec 2026 09:36:20 +0300 Subject: [PATCH] B17: cros-libva config: query_surface_attributes wrote through a *const cast (UB); use let mut attrs_len and &mut --- shims/cros-libva/src/config.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/shims/cros-libva/src/config.rs b/shims/cros-libva/src/config.rs index 77550620..777b3a30 100644 --- a/shims/cros-libva/src/config.rs +++ b/shims/cros-libva/src/config.rs @@ -74,13 +74,13 @@ impl Config { // Safe because `self` represents a valid VAConfig. We first query how // much space is needed by the C API by passing in NULL in the first // call to `vaQuerySurfaceAttributes`. - let attrs_len: std::os::raw::c_uint = 0; + let mut attrs_len: std::os::raw::c_uint = 0; va_check(unsafe { bindings::vaQuerySurfaceAttributes( self.display.handle(), self.id, std::ptr::null_mut(), - &attrs_len as *const _ as *mut std::os::raw::c_uint, + &mut attrs_len, ) })?; @@ -93,7 +93,7 @@ impl Config { self.display.handle(), self.id, attrs.as_mut_ptr(), - &attrs_len as *const _ as *mut std::os::raw::c_uint, + &mut attrs_len, ) })?;