Correct bounds check of blitClip array access

Array is defined as blitClip[NUM_BLIT_PORTS], so invalid indexes
are >= NUM_BLIT_PORTS, not just > NUM_BLIT_PORTS

[This bug was found by the Parfait bug checking tool.
 For more information see http://research.sun.com/projects/parfait ]

Signed-off-by: Alan Coopersmith <alan.coopersmith@sun.com>
This commit is contained in:
Alan Coopersmith
2009-05-01 16:57:22 -07:00
parent 49c641b638
commit 933dd8f860

View File

@@ -4174,7 +4174,7 @@ SISStopVideoBlit(ScrnInfoPtr pScrn, ULong index, Bool shutdown)
* adapt->flags but we provide it anyway.
*/
if(index > NUM_BLIT_PORTS) return;
if(index >= NUM_BLIT_PORTS) return;
REGION_EMPTY(pScrn->pScreen, &pPriv->blitClip[index]);
@@ -4214,7 +4214,7 @@ SISPutImageBlit(
SiS_Packet12_YUV MyPacket;
Bool first;
if(index > NUM_BLIT_PORTS) return BadMatch;
if(index >= NUM_BLIT_PORTS) return BadMatch;
if(!height || !width) return Success;