Skip to content

Commit c57dc62

Browse files
committed
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>
1 parent ad64eb9 commit c57dc62

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

va/wayland/va_wayland.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,9 @@ vaGetDisplayWl(struct wl_display *display)
116116
struct VADriverVTableWayland *vtable;
117117
unsigned int i;
118118

119+
if (!display)
120+
return NULL;
121+
119122
pDisplayContext = va_newDisplayContext();
120123
if (!pDisplayContext)
121124
return NULL;

0 commit comments

Comments
 (0)