xf86-video-intel: src/intel_dri.c

Chris Wilson ickle at kemper.freedesktop.org
Fri Oct 8 07:26:03 PDT 2010


 src/intel_dri.c |   18 ++++++++++++------
 1 file changed, 12 insertions(+), 6 deletions(-)

New commits:
commit 5472359d6860af655a3c286d30558540376c9fdb
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date:   Fri Oct 8 15:23:13 2010 +0100

    dri: Check for pixmap privates before dereferencing them
    
    It is still possible for the pixmap allocator to return a software only
    pixmap (i.e. without an associated GEM buffer or intel_pixmap), so check
    before dereferencing.
    
    Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=30707
    Reported-by: Matthias Hopf <mhopf at suse.de>
    Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>

diff --git a/src/intel_dri.c b/src/intel_dri.c
index 7fd8655..97f9c4a 100644
--- a/src/intel_dri.c
+++ b/src/intel_dri.c
@@ -510,12 +510,16 @@ I830DRI2CopyRegion(DrawablePtr drawable, RegionPtr pRegion,
 		struct intel_pixmap *src_pixmap, *dst_pixmap;
 
 		src_pixmap = intel_get_pixmap_private(get_drawable_pixmap(src));
-		src_pixmap->offscreen = 1;
-		src_pixmap->busy = 1;
+		if (src_pixmap) {
+			src_pixmap->offscreen = 1;
+			src_pixmap->busy = 1;
+		}
 
 		dst_pixmap = intel_get_pixmap_private(get_drawable_pixmap(dst));
-		dst_pixmap->offscreen = 1;
-		dst_pixmap->busy = 1;
+		if (dst_pixmap) {
+			dst_pixmap->offscreen = 1;
+			dst_pixmap->busy = 1;
+		}
 
 		gc->ops->CopyArea(src, dst, gc,
 				  0, 0,
@@ -523,8 +527,10 @@ I830DRI2CopyRegion(DrawablePtr drawable, RegionPtr pRegion,
 				  0, 0);
 
 		/* and restore 2D/3D coherency */
-		src_pixmap->offscreen = 0;
-		dst_pixmap->offscreen = 0;
+		if (src_pixmap)
+			src_pixmap->offscreen = 0;
+		if (dst_pixmap)
+			dst_pixmap->offscreen = 0;
 	} else {
 		gc->ops->CopyArea(src, dst, gc,
 				  0, 0,


More information about the xorg-commit mailing list