[PATCH] xf86xv: Fix off-by-one in viewport clipping
Maarten Maathuis
madman2003 at gmail.com
Tue Dec 15 00:43:38 PST 2009
CC'ing to keithp, since he's the one that has to pick this up.
Maarten.
On Mon, Dec 14, 2009 at 6:19 PM, <ville.syrjala at nokia.com> wrote:
> From: Ville Syrjälä <ville.syrjala at nokia.com>
>
> Most of the Xv Put/Get operations have an off by one error in the
> viewport clipping.
>
> Apparently PutImage was fixed at some point but the same code was
> already copy-pasted all over the place, and so the other operations
> still suffer from the bug.
>
> Signed-off-by: Ville Syrjälä <ville.syrjala at nokia.com>
> Reviewed-by: Tiago Vignatti <tiago.vignatti at nokia.com>
> ---
> hw/xfree86/common/xf86xv.c | 12 ++++++------
> 1 files changed, 6 insertions(+), 6 deletions(-)
>
> diff --git a/hw/xfree86/common/xf86xv.c b/hw/xfree86/common/xf86xv.c
> index abbe033..67c2b4f 100644
> --- a/hw/xfree86/common/xf86xv.c
> +++ b/hw/xfree86/common/xf86xv.c
> @@ -787,8 +787,8 @@ xf86XVReputVideo(XvPortRecPrivatePtr portPriv)
>
> VPBox.x1 = portPriv->pScrn->frameX0;
> VPBox.y1 = portPriv->pScrn->frameY0;
> - VPBox.x2 = portPriv->pScrn->frameX1;
> - VPBox.y2 = portPriv->pScrn->frameY1;
> + VPBox.x2 = portPriv->pScrn->frameX1 + 1;
> + VPBox.y2 = portPriv->pScrn->frameY1 + 1;
>
> REGION_INIT(pScreen, &VPReg, &VPBox, 1);
> REGION_INTERSECT(pScreen, &ClipRegion, &ClipRegion, &VPReg);
> @@ -877,8 +877,8 @@ xf86XVReputImage(XvPortRecPrivatePtr portPriv)
>
> VPBox.x1 = portPriv->pScrn->frameX0;
> VPBox.y1 = portPriv->pScrn->frameY0;
> - VPBox.x2 = portPriv->pScrn->frameX1;
> - VPBox.y2 = portPriv->pScrn->frameY1;
> + VPBox.x2 = portPriv->pScrn->frameX1 + 1;
> + VPBox.y2 = portPriv->pScrn->frameY1 + 1;
>
> REGION_INIT(pScreen, &VPReg, &VPBox, 1);
> REGION_INTERSECT(pScreen, &ClipRegion, &ClipRegion, &VPReg);
> @@ -1433,8 +1433,8 @@ xf86XVPutStill(
>
> VPBox.x1 = portPriv->pScrn->frameX0;
> VPBox.y1 = portPriv->pScrn->frameY0;
> - VPBox.x2 = portPriv->pScrn->frameX1;
> - VPBox.y2 = portPriv->pScrn->frameY1;
> + VPBox.x2 = portPriv->pScrn->frameX1 + 1;
> + VPBox.y2 = portPriv->pScrn->frameY1 + 1;
>
> REGION_INIT(pScreen, &VPReg, &VPBox, 1);
> REGION_INTERSECT(pScreen, &ClipRegion, &ClipRegion, &VPReg);
> --
> 1.6.4.4
>
> _______________________________________________
> xorg-devel mailing list
> xorg-devel at lists.x.org
> http://lists.x.org/mailman/listinfo/xorg-devel
>
More information about the xorg-devel
mailing list