From 3fb97d78202213c1221a1d3ad8a5cebda78fdf44 Mon Sep 17 00:00:00 2001 From: Maarten Lankhorst Date: Thu, 23 Oct 2014 09:29:14 +0200 Subject: fix null pointer deref --- src/nouveau_dri2.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/nouveau_dri2.c b/src/nouveau_dri2.c index 6876f9c..e3445b2 100644 --- a/src/nouveau_dri2.c +++ b/src/nouveau_dri2.c @@ -1097,8 +1097,8 @@ static int nouveau_dri3_fd_from_pixmap(ScreenPtr screen, PixmapPtr pixmap, CARD1 struct nouveau_bo *bo = nouveau_pixmap_bo(pixmap); int fd; - if (nouveau_bo_set_prime(bo, &fd) < 0) - return -1; + if (!bo || nouveau_bo_set_prime(bo, &fd) < 0) + return -EINVAL; *stride = pixmap->devKind; *size = bo->size; -- cgit v1.2.1