va: reject NULL display in vaGetDisplayWl() Add a null-pointer check for the display parameter at the entry of vaGetDisplayWl(), returning NULL immediately instead of proceeding to backend initialization which would crash with a null dereference. This aligns the Wayland constructor with the X11 and DRM constructors which already validate their native display/fd arguments early. Signed-off-by: Carl.Zhang <carl.zhang@intel.com>
diff --git a/va/wayland/va_wayland.c b/va/wayland/va_wayland.c index 759b055..2f4c42c 100644 --- a/va/wayland/va_wayland.c +++ b/va/wayland/va_wayland.c
@@ -116,6 +116,9 @@ struct VADriverVTableWayland *vtable; unsigned int i; + if (!display) + return NULL; + pDisplayContext = va_newDisplayContext(); if (!pDisplayContext) return NULL;