summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZhigang Gong <zhigang.gong@linux.intel.com>2012-08-02 18:07:07 +0800
committerZhigang Gong <zhigang.gong@linux.intel.com>2012-08-02 18:07:07 +0800
commitf0fcbd52850f84f928e907520718a9ae5588e8e9 (patch)
tree8b839faf024957511b35050377a5d962b5f45f21
parent8664f0d86d7e9abb103dd5c92945caf7ab5fd4b8 (diff)
glamor: glamor_glyphs: When dst arg point to a NULL buffer, dont't flush.
This is a corner case, when we render glyphs via mask cache, and when we need to upload new glyphs cache, we need to flush both the mask and dest buffer. But we the dest arg may point to a NULL buffer at that time, we need to check it firstly. If the dest buffer is NULL. Then we don't need to flush both the dest and mask buffer. This commit fix a potential crash. Signed-off-by: Zhigang Gong <zhigang.gong@linux.intel.com>
-rw-r--r--glamor_glyphs.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/glamor_glyphs.c b/glamor_glyphs.c
index bab2c24..f549904 100644
--- a/glamor_glyphs.c
+++ b/glamor_glyphs.c
@@ -1193,6 +1193,9 @@ glamor_glyphs_flush_mask(struct glyphs_flush_mask_arg *arg)
static void
glamor_glyphs_flush_dst(struct glyphs_flush_dst_arg * arg)
{
+ if (!arg->buffer)
+ return;
+
if (mask_buffer.count > 0) {
glamor_glyphs_flush_mask(&mask_arg);
}