[PATCH] dri2: Initialize padding in DRI2GetBuffers reply
Daniel Stone
daniel at fooishbar.org
Wed Mar 2 03:37:52 PST 2011
Hi,
On Wed, Feb 23, 2011 at 07:01:04PM +0200, Pauli wrote:
> diff --git a/hw/xfree86/dri2/dri2ext.c b/hw/xfree86/dri2/dri2ext.c
> index 4e48e65..725823e 100644
> --- a/hw/xfree86/dri2/dri2ext.c
> +++ b/hw/xfree86/dri2/dri2ext.c
> @@ -227,11 +227,15 @@ send_buffers_reply(ClientPtr client, DrawablePtr pDrawable,
> }
>
> rep.type = X_Reply;
> + rep.pad1 = 0;
> rep.length = (count - skip) * sizeof(xDRI2Buffer) / 4;
> rep.sequenceNumber = client->sequence;
> rep.width = width;
> rep.height = height;
> rep.count = count - skip;
> + rep.pad2 = 0;
> + rep.pad3 = 0;
> + rep.pad4 = 0;
> WriteToClient(client, sizeof(xDRI2GetBuffersReply), &rep);
>
> for (i = 0; i < count; i++) {
Why not just memset(&rep, 0, sizeof(rep)) before you start filling it
in?
Cheers,
Daniel
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: Digital signature
URL: <http://lists.x.org/archives/xorg-devel/attachments/20110302/919fe04a/attachment.pgp>
More information about the xorg-devel
mailing list