summaryrefslogtreecommitdiff
authorIan Romanick <ian.d.romanick@intel.com>2009-04-15 18:13:48 (GMT)
committer Ian Romanick <ian.d.romanick@intel.com>2009-04-15 18:14:58 (GMT)
commitde1e43181bd670877b994db221ad8a04b5d63324 (patch) (side-by-side diff)
treed0742c4d3a77bedc70b1ce459525a6e06b12fc7e
parentb3e3154cce47add97f5561088036ce3b9e7dc937 (diff)
downloadxserver-de1e43181bd670877b994db221ad8a04b5d63324.zip
xserver-de1e43181bd670877b994db221ad8a04b5d63324.tar.gz
DRI2: Don't leave empty entries in private->buffers
This should fix bug #21130. Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--glx/glxdri2.c17
1 files changed, 9 insertions, 8 deletions
diff --git a/glx/glxdri2.c b/glx/glxdri2.c
index 9dac8a6..9e452c4 100644
--- a/glx/glxdri2.c
+++ b/glx/glxdri2.c
@@ -408,7 +408,7 @@ dri2GetBuffers(__DRIdrawable *driDrawable,
__GLXDRIdrawable *private = loaderPrivate;
DRI2BufferPtr buffers;
int i;
- int skip = 0;
+ int j;
buffers = DRI2GetBuffers(private->base.pDraw,
width, height, attachments, count, out_count);
@@ -422,23 +422,24 @@ dri2GetBuffers(__DRIdrawable *driDrawable,
/* This assumes the DRI2 buffer attachment tokens matches the
* __DRIbuffer tokens. */
+ j = 0;
for (i = 0; i < *out_count; i++) {
/* Do not send the real front buffer of a window to the client.
*/
if ((private->base.pDraw->type == DRAWABLE_WINDOW)
&& (buffers[i].attachment == DRI2BufferFrontLeft)) {
- skip++;
continue;
}
- private->buffers[i].attachment = buffers[i].attachment;
- private->buffers[i].name = buffers[i].name;
- private->buffers[i].pitch = buffers[i].pitch;
- private->buffers[i].cpp = buffers[i].cpp;
- private->buffers[i].flags = buffers[i].flags;
+ private->buffers[j].attachment = buffers[i].attachment;
+ private->buffers[j].name = buffers[i].name;
+ private->buffers[j].pitch = buffers[i].pitch;
+ private->buffers[j].cpp = buffers[i].cpp;
+ private->buffers[j].flags = buffers[i].flags;
+ j++;
}
- *out_count -= skip;
+ *out_count = j;
return private->buffers;
}