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:
parent
e7af7cb76d
commit
f62f4d53ef
|
@ -1193,6 +1193,9 @@ glamor_glyphs_flush_mask(struct glyphs_flush_mask_arg *arg)
|
||||||
static void
|
static void
|
||||||
glamor_glyphs_flush_dst(struct glyphs_flush_dst_arg * arg)
|
glamor_glyphs_flush_dst(struct glyphs_flush_dst_arg * arg)
|
||||||
{
|
{
|
||||||
|
if (!arg->buffer)
|
||||||
|
return;
|
||||||
|
|
||||||
if (mask_buffer.count > 0) {
|
if (mask_buffer.count > 0) {
|
||||||
glamor_glyphs_flush_mask(&mask_arg);
|
glamor_glyphs_flush_mask(&mask_arg);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user