mirror of
https://github.com/X11Libre/xf86-video-sis.git
synced 2026-03-24 01:25:01 +00:00
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:
@@ -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;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user