summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAlex VillacĂ­s Lasso <a_villacis@palosanto.com>2008-01-30 21:46:11 -0500
committerAlex Deucher <alex@botch2.(none)>2008-01-30 21:46:11 -0500
commitefd4ae6fda22a9283663cde23e6deead13130f6f (patch)
tree17d3bbb5f3d5638747bd85a72bdeee445d2cc5e6 /src
parentee5b54a66495e51fb2a27b4ecb5875dae776b3c9 (diff)
[PATCH] Prevent use of BCI for YV12 -> YUY2 conversion from scribbling past the end of the allocated video buffer.
Diffstat (limited to 'src')
-rw-r--r--src/savage_video.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/savage_video.c b/src/savage_video.c
index cb944a4..351dde9 100644
--- a/src/savage_video.c
+++ b/src/savage_video.c
@@ -1177,7 +1177,7 @@ SavageCopyPlanarDataBCI(
SavagePtr psav = SAVPTR(pScrn);
/* half of the dest buffer for copying the YVU data to it ??? */
unsigned char *dstCopy = (unsigned char *)(((unsigned long)dst
- + 2 * srcPitch * h
+ + dstPitch * h
+ 0x0f) & ~0x0f);
/* for pixel transfer */
unsigned long offsetY = (unsigned long)dstCopy - (unsigned long)psav->FBBase;
@@ -1909,6 +1909,10 @@ SavagePutImage(
break;
}
+ if (srcPitch2 != 0 && S3_SAVAGE4_SERIES(psav->Chipset) && psav->BCIforXv) {
+ new_size = ((new_size + 0xF) & ~0xF) + srcPitch * height + srcPitch2 * height;
+ }
+
/* if(!(pPriv->area = SavageAllocateMemory(pScrn, pPriv->area, new_h)))
return BadAlloc;*/
pPriv->video_offset = SavageAllocateMemory(pScrn, &pPriv->video_memory,