summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlan Coopersmith <alan.coopersmith@oracle.com>2018-09-22 15:51:49 -0700
committerAlan Coopersmith <alan.coopersmith@oracle.com>2018-09-22 15:52:39 -0700
commit28ad81420723175bfb163e20406af6d4d56bf4d4 (patch)
treea0edb2630311857fcb8ee3af02824e6e0be30a55
parent68d0e5a122c6c76c19cc58ce9cea1424c7a5db11 (diff)
Need to check for -1, not 0, to determine if shmat() failed
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
-rw-r--r--src/XvMC.c2
1 files changed, 1 insertions, 1 deletions
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;