dri2: Don't crash if the server returns more buffers than expected.

This commit is contained in:
Eric Anholt 2009-02-08 15:26:30 +01:00
parent 680c708dee
commit f967e8b507

View file

@ -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);