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>
This commit is contained in:
Zhigang Gong 2012-08-02 18:07:07 +08:00 committed by Eric Anholt
parent e7af7cb76d
commit f62f4d53ef

View File

@ -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);
}