From: Eric Anholt Date: Sun, 8 Feb 2009 14:26:30 +0000 (+0100) Subject: dri2: Don't crash if the server returns more buffers than expected. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=f967e8b507990f0d7986e0f83924e6587d70200d;p=mesa.git dri2: Don't crash if the server returns more buffers than expected. --- diff --git a/src/glx/x11/dri2.c b/src/glx/x11/dri2.c index 3b48cd9c1ca..f967432b994 100644 --- a/src/glx/x11/dri2.c +++ b/src/glx/x11/dri2.c @@ -253,7 +253,7 @@ DRI2Buffer *DRI2GetBuffers(Display *dpy, XID drawable, *height = rep.height; *outCount = rep.count; - buffers = Xmalloc(count * sizeof buffers[0]); + buffers = Xmalloc(rep.count * sizeof buffers[0]); if (buffers == NULL) { _XEatData(dpy, rep.count * sizeof repBuffer); UnlockDisplay(dpy);