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
commitded419455c67846d75944c75d623d6e1c510db9f (patch)
treeb9ab598449741efafaa3e8233a2fdfd6b5617e3c
parentf233aeef15ca357c9a0a770687d13b6560871420 (diff)
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--src/glamor_glyphs.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/glamor_glyphs.c b/src/glamor_glyphs.c
index bab2c24..f549904 100644
--- a/src/glamor_glyphs.c
+++ b/src/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);
}