summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlan Coopersmith <alan.coopersmith@oracle.com>2013-06-22 21:47:34 -0700
committerAlan Coopersmith <alan.coopersmith@oracle.com>2013-07-05 21:15:00 -0700
commit29b23d387e32d09e1b34682f01cee899a08a1176 (patch)
treeeb476b06aef9d71971f4de0d4a4a1cbef0cb31ac
parent5a09a55b5b13280990465d83205e796bb8cd68ac (diff)
Add missing calls to _XEatDataWords when we are skipping _XRead
If we failed to allocate the buffer to _XRead into, discard the rest of the reply, instead of leaving it to confuse the reading of the next reply. Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
-rw-r--r--src/Xv.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/Xv.c b/src/Xv.c
index b4e2158..8e069c0 100644
--- a/src/Xv.c
+++ b/src/Xv.c
@@ -194,6 +194,7 @@ XvQueryAdaptors(
size = rep.length << 2;
if ((buffer = Xmalloc(size)) == NULL) {
+ _XEatDataWords(dpy, rep.length);
UnlockDisplay(dpy);
SyncHandle();
return (XvBadAlloc);
@@ -351,6 +352,7 @@ XvQueryEncodings(
size = rep.length << 2;
if ((buffer = Xmalloc(size)) == NULL) {
+ _XEatDataWords(dpy, rep.length);
UnlockDisplay(dpy);
SyncHandle();
return (XvBadAlloc);