glamor: Make glamor_set_pixmap_private not crash if the pixmap has no fbo

Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
Reviewed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
This commit is contained in:
Michel Dänzer 2014-12-11 16:50:38 +09:00 committed by Keith Packard
parent 45b333525e
commit 0355e280a3

View File

@ -563,8 +563,11 @@ glamor_set_pixmap_private(PixmapPtr pixmap, glamor_pixmap_private *priv)
else {
if (old_priv == NULL)
return;
fbo = glamor_pixmap_detach_fbo(old_priv);
glamor_purge_fbo(fbo);
if (old_priv->base.fbo) {
fbo = glamor_pixmap_detach_fbo(old_priv);
glamor_purge_fbo(fbo);
}
free(old_priv);
}