[PATCH:libXv 6/7] Add missing calls to _XEatDataWords when we are skipping _XRead
Alan Coopersmith
alan.coopersmith at oracle.com
Sun Jun 23 11:53:49 PDT 2013
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 at oracle.com>
---
src/Xv.c | 2 ++
1 file changed, 2 insertions(+)
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);
--
1.7.9.2
More information about the xorg-devel
mailing list