From 948fa20bd639752af3a6f1b30a0b2b356d0bc9a5 Mon Sep 17 00:00:00 2001 From: Kalev Lember Date: Fri, 20 Mar 2009 02:21:41 +0200 Subject: Fix VT switch with XV overlay video enabled. drm_intel_bo_unpin() was called with NULL argument. Signed-off-by: Kalev Lember (cherry picked from commit 74d0713e002a9781ed00fdd10eb6f75907ae796c) --- src/i830_video.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) (limited to 'src') diff --git a/src/i830_video.c b/src/i830_video.c index 3c6fbf36..3f3aaacf 100644 --- a/src/i830_video.c +++ b/src/i830_video.c @@ -1048,11 +1048,14 @@ I830StopVideo(ScrnInfoPtr pScrn, pointer data, Bool shutdown) if (pPriv->videoStatus & CLIENT_VIDEO_ON) { i830_overlay_off(pScrn); } - if (!pPriv->textured) - drm_intel_bo_unpin(pPriv->buf); - drm_intel_bo_unreference(pPriv->buf); - pPriv->buf = NULL; - pPriv->videoStatus = 0; + + if (pPriv->buf) { + if (!pPriv->textured) + drm_intel_bo_unpin(pPriv->buf); + drm_intel_bo_unreference(pPriv->buf); + pPriv->buf = NULL; + pPriv->videoStatus = 0; + } } else { if (pPriv->videoStatus & CLIENT_VIDEO_ON) { pPriv->videoStatus |= OFF_TIMER; -- cgit v1.2.3