public inbox for intel-gfx@lists.freedesktop.org
 help / color / mirror / Atom feed
From: Maarten Lankhorst <maarten.lankhorst@canonical.com>
To: intel-gfx@lists.freedesktop.org
Cc: dri-devel@lists.freedesktop.org
Subject: [PATCH] intel uxa: Fix use-after-free
Date: Tue, 19 Jun 2012 17:53:44 +0200	[thread overview]
Message-ID: <4FE0A088.4090807@canonical.com> (raw)

white is set to src if used, but src can be used in the maskFormat too.
Fixes crash when logging in on a sandybridge laptop.

Signed-off-by: Maarten Lankhorst <maarten.lankhorst@canonical.com>

---

diff --git a/uxa/uxa-glyphs.c b/uxa/uxa-glyphs.c
index e83464e..4b81756 100644
--- a/uxa/uxa-glyphs.c
+++ b/uxa/uxa-glyphs.c
@@ -538,9 +538,6 @@ uxa_check_glyphs(CARD8 op,
 		list++;
 	}
 
-	if (white)
-		FreePicture(white, 0);
-
 	if (maskFormat) {
 		x = extents.x1;
 		y = extents.y1;
@@ -554,6 +551,9 @@ uxa_check_glyphs(CARD8 op,
 		FreeScratchPixmapHeader(scratch);
 		pixman_image_unref(image);
 	}
+
+	if (white)
+		FreePicture(white, 0);
 }
 
 static inline unsigned int

                 reply	other threads:[~2012-06-19 15:53 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4FE0A088.4090807@canonical.com \
    --to=maarten.lankhorst@canonical.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=intel-gfx@lists.freedesktop.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox