Mesa (master): gbm/dri: avoid crash in dri_screen_create

Benjamin Franzke bnf at kemper.freedesktop.org
Thu Aug 4 05:18:33 PDT 2011


Module: Mesa
Branch: master
Commit: eeed782ecb9fa92a958cb650c0a5a536556dc611
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=eeed782ecb9fa92a958cb650c0a5a536556dc611

Author: RALOVICH, Kristóf <tade60 at freemail.hu>
Date:   Sun Jul 31 23:49:43 2011 +0200

gbm/dri: avoid crash in dri_screen_create

---

 src/gbm/backends/dri/gbm_dri.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/src/gbm/backends/dri/gbm_dri.c b/src/gbm/backends/dri/gbm_dri.c
index 6bb7848..9de8cb6 100644
--- a/src/gbm/backends/dri/gbm_dri.c
+++ b/src/gbm/backends/dri/gbm_dri.c
@@ -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) {



More information about the mesa-commit mailing list