xv: test correct number of requests. (v2)

Pointed out by coverity.

v2: fix swapped as well, as pointed out by Alan

Signed-off-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
(cherry picked from commit 41229392b7)
This commit is contained in:
Dave Airlie 2011-10-20 11:00:43 +01:00 committed by Jeremy Huddleston
parent 500213c1ae
commit a10fbf0043

View file

@ -1265,7 +1265,7 @@ ProcXvDispatch(ClientPtr client)
UpdateCurrentTime();
if (stuff->data > xvNumRequests) {
if (stuff->data >= xvNumRequests) {
SendErrorToClient(client, XvReqCode, stuff->data, 0, BadRequest);
return BadRequest;
}
@ -1589,7 +1589,7 @@ SProcXvDispatch(ClientPtr client)
UpdateCurrentTime();
if (stuff->data > xvNumRequests) {
if (stuff->data >= xvNumRequests) {
SendErrorToClient(client, XvReqCode, stuff->data, 0, BadRequest);
return BadRequest;
}