xf86-video-intel: 2 commits - src/sna/sna_video_sprite.c src/uxa/intel_display.c

Chris Wilson ickle at kemper.freedesktop.org
Mon Feb 15 10:42:07 UTC 2016


 src/sna/sna_video_sprite.c |    3 +++
 src/uxa/intel_display.c    |    8 +++++---
 2 files changed, 8 insertions(+), 3 deletions(-)

New commits:
commit e41040fb55e84fc72612ae503944a99814a5c9d3
Author: Martin Peres <martin.peres at linux.intel.com>
Date:   Fri Feb 12 17:33:24 2016 +0200

    sna_video_sprite: add asserts to catch invalid pipe#
    
    Caught by Klockwork. This will be enough to catch those issues during
    bringup.
    
    Signed-off-by: Martin Peres <martin.peres at linux.intel.com>
    Reviewed-by: Chris Wilson <chris at chris-wilson.co.uk>

diff --git a/src/sna/sna_video_sprite.c b/src/sna/sna_video_sprite.c
index 9e85049..ae08ef7 100644
--- a/src/sna/sna_video_sprite.c
+++ b/src/sna/sna_video_sprite.c
@@ -86,6 +86,7 @@ static int sna_video_sprite_stop(ddStopVideo_ARGS)
 		int pipe;
 
 		pipe = sna_crtc_pipe(crtc);
+		assert(pipe < ARRAY_SIZE(video->bo));
 		if (video->bo[pipe] == NULL)
 			continue;
 
@@ -260,6 +261,7 @@ sna_video_sprite_show(struct sna *sna,
 		video->color_key_changed &= ~(1 << pipe);
 	}
 
+	assert(pipe < ARRAY_SIZE(video->bo));
 	if (video->bo[pipe] == frame->bo)
 		return true;
 
@@ -415,6 +417,7 @@ static int sna_video_sprite_put_image(ddPutImage_ARGS)
 		RegionIntersect(&reg, &reg, &clip);
 		if (RegionNil(&reg)) {
 off:
+			assert(pipe < ARRAY_SIZE(video->bo));
 			if (video->bo[pipe]) {
 				struct local_mode_set_plane s;
 				memset(&s, 0, sizeof(s));
commit 7c81719b7fcba091fe2e9cf6fb7cb62a13d4f1dd
Author: Martin Peres <martin.peres at linux.intel.com>
Date:   Thu Feb 11 12:19:13 2016 +0200

    display: prevent a NULL pointer dereference in intel_set_scanout_pixmap
    
    Caught by Klockwork.
    
    v2:
     - be less verbose on failure
    
    Signed-off-by: Martin Peres <martin.peres at linux.intel.com>

diff --git a/src/uxa/intel_display.c b/src/uxa/intel_display.c
index 8bf0184..fa371c6 100644
--- a/src/uxa/intel_display.c
+++ b/src/uxa/intel_display.c
@@ -688,9 +688,11 @@ intel_set_scanout_pixmap(xf86CrtcPtr crtc, PixmapPtr ppix)
 	}
 
 	bo = intel_get_pixmap_bo(ppix);
-	if (intel->front_buffer) {
-		ErrorF("have front buffer\n");
-	}
+	if (!bo)
+		return FALSE;
+
+	if (intel->front_buffer)
+		return FALSE;
 
 	drm_intel_bo_disable_reuse(bo);
 


More information about the xorg-commit mailing list