summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMaarten Lankhorst <maarten.lankhorst@ubuntu.com>2014-10-23 09:29:14 +0200
committerMaarten Lankhorst <maarten.lankhorst@ubuntu.com>2014-10-23 09:29:14 +0200
commit3fb97d78202213c1221a1d3ad8a5cebda78fdf44 (patch)
tree56fd649d45eab0c72b355212ac6cbdf25209a31a
parent90ba0bb6a371a5beebdf6d363bcd73659b7c9f1f (diff)
fix null pointer deref
-rw-r--r--src/nouveau_dri2.c4
1 files 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;