Generate proper error for NULL display.
[profile/ivi/libva.git] / src / va.c
index 8b9b73b..9ff365a 100644 (file)
--- a/src/va.c
+++ b/src/va.c
@@ -72,6 +72,11 @@ VADisplay vaGetDisplay (
   VADisplay dpy = NULL;
   VADriverContextP ctx = pDriverContexts;
 
+  if (!native_dpy)
+  {
+      return NULL;
+  }
+
   while (ctx)
   {
       if (ctx->x11_dpy == (Display *)native_dpy)