gbm/dri: avoid crash in dri_screen_create
authorRALOVICH, Kristóf <tade60@freemail.hu>
Sun, 31 Jul 2011 21:49:43 +0000 (23:49 +0200)
committerBenjamin Franzke <benjaminfranzke@googlemail.com>
Thu, 4 Aug 2011 12:09:34 +0000 (14:09 +0200)
src/gbm/backends/dri/gbm_dri.c

index 6bb7848d8302fba86d815619c72eca0fb4008420..9de8cb61162c13ec1095c677559b19ce78fdc4dc 100644 (file)
@@ -194,6 +194,8 @@ dri_screen_create(struct gbm_dri_device *dri)
    dri->screen = dri->dri2->createNewScreen(0, dri->base.base.fd,
                                             dri->extensions,
                                             &dri->driver_configs, dri);
+   if (dri->screen == NULL)
+      return -1;
 
    extensions = dri->core->getExtensions(dri->screen);
    if (dri_bind_extensions(dri, dri_core_extensions, extensions) < 0) {