From 28ad81420723175bfb163e20406af6d4d56bf4d4 Mon Sep 17 00:00:00 2001 From: Alan Coopersmith Date: Sat, 22 Sep 2018 15:51:49 -0700 Subject: Need to check for -1, not 0, to determine if shmat() failed Signed-off-by: Alan Coopersmith --- src/XvMC.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/XvMC.c b/src/XvMC.c index d97861f..736760b 100644 --- a/src/XvMC.c +++ b/src/XvMC.c @@ -526,7 +526,7 @@ Status XvMCGetDRInfo(Display *dpy, XvPortID port, if (shmKey >= 0) { shMem = (CARD32 *) shmat(shmKey, NULL, 0); shmctl(shmKey, IPC_RMID, NULL); - if ( shMem ) { + if (shMem != (void *) -1) { register volatile CARD32 *shMemC = shMem; register int i; -- cgit v1.2.3