diff options
author | Maarten Lankhorst <maarten.lankhorst@ubuntu.com> | 2014-10-23 09:29:14 +0200 |
---|---|---|
committer | Maarten Lankhorst <maarten.lankhorst@ubuntu.com> | 2014-10-23 09:29:14 +0200 |
commit | 3fb97d78202213c1221a1d3ad8a5cebda78fdf44 (patch) | |
tree | 56fd649d45eab0c72b355212ac6cbdf25209a31a | |
parent | 90ba0bb6a371a5beebdf6d363bcd73659b7c9f1f (diff) | |
download | xorg-driver-xf86-video-nouveau-3fb97d78202213c1221a1d3ad8a5cebda78fdf44.tar.gz |
fix null pointer deref
-rw-r--r-- | src/nouveau_dri2.c | 4 |
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; |