From 8087bc23a7662f1426a8bd6febf0d5d3844e6107 Mon Sep 17 00:00:00 2001 From: Francisco Jerez Date: Wed, 16 Jun 2010 14:59:37 +0200 Subject: xv: Make sure we have a CRTC before setting up the overlay. Fixes a segfault when the destination area is off screen. Signed-off-by: Francisco Jerez Tested-by: Krzysztof Halasa --- src/smi_video.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'src/smi_video.c') diff --git a/src/smi_video.c b/src/smi_video.c index c2e8868..57587ac 100644 --- a/src/smi_video.c +++ b/src/smi_video.c @@ -1060,7 +1060,7 @@ SMI_PutVideo( if(!xf86_crtc_clip_video_helper(pScrn, &crtc, crtcConf->crtc[0], &dstBox, &x1, &x2, &y1, &y2, clipBoxes, width, height)) LEAVE(Success); - if(pSmi->Dualhead && crtc == crtcConf->crtc[1]) + if (crtc != crtcConf->crtc[0]) LEAVE(Success); /* Transform dstBox to the CRTC coordinates */ @@ -1521,6 +1521,9 @@ SMI_PutImage( width, height)) LEAVE(Success); + if (!crtc) + LEAVE(Success); + /* Transform dstBox to the CRTC coordinates */ dstBox.x1 -= crtc->x; dstBox.y1 -= crtc->y; @@ -2468,6 +2471,9 @@ SMI_DisplaySurface( &x1, &x2, &y1, &y2, clipBoxes, surface->width, surface->height)) LEAVE(Success); + if (!crtc) + LEAVE(Success); + /* Transform dstBox to the CRTC coordinates */ dstBox.x1 -= crtc->x; dstBox.y1 -= crtc->y; -- cgit v1.2.3