mirror of
https://github.com/X11Libre/xf86-video-vmware.git
synced 2026-03-24 01:24:37 +00:00
vmware/vmwgfx: Fix an error path segfault
Part of freedesktop.org bugzilla bug #80645 If taking a scanout reference on a pixmap fails, the struct vmwgfx_screen_entry::pixmap pointer must be set to NULL, otherwise the driver will incorrectly attempt to remove the scanout reference in the error path, causing a segfault. This problem is seen in the above-mentioned bug, but it is not the root cause of the problem. With this patch applied, the server will terminate cleanly instead of segfaulting. Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com> Reviewed-by: Jakob Bornecrantz <jakob@vmware.com>
This commit is contained in:
@@ -193,6 +193,7 @@ crtc_set_mode_major(xf86CrtcPtr crtc, DisplayModePtr mode,
|
||||
crtcp->entry.pixmap = pixmap;
|
||||
crtcp->scanout_id = vmwgfx_scanout_ref(&crtcp->entry);
|
||||
if (crtcp->scanout_id == -1) {
|
||||
crtcp->entry.pixmap = NULL;
|
||||
LogMessage(X_ERROR, "Failed to convert pixmap to scanout.\n");
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user