mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-03-11 20:00:38 +01:00
dri: avoid NULL deref of DrawBuffer on flush
The same problem with17e62a3c23fixed for i965 with6bc710d769exists with other drivers. With Mesa 21.3.6 on radeon r100 it shows as: _mesa_is_winsys_fbo (fb=0x0) radeonFlush _mesa_make_current _mesa_free_context_data radeonDestroyContext driDestroyContext dri2_destroy_context glx_display_free __glXCloseDisplay XCloseDisplay Follow the i965 change and add a NULL test before flush for radeon, i915 and nouveau. Fixes:17e62a3c23("mesa: (correctly) flush more in _mesa_make_current") Reviewed-by: Adam Jackson <ajax@redhat.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14989>
This commit is contained in:
parent
fef2cdb0a5
commit
f911daf16d
3 changed files with 5 additions and 3 deletions
|
|
@ -111,7 +111,8 @@ intel_flush_front(struct gl_context *ctx)
|
|||
__DRIdrawable *driDrawable = driContext->driDrawablePriv;
|
||||
__DRIscreen *const screen = intel->intelScreen->driScrnPriv;
|
||||
|
||||
if (intel->front_buffer_dirty && _mesa_is_winsys_fbo(ctx->DrawBuffer)) {
|
||||
if (intel->front_buffer_dirty && ctx->DrawBuffer &&
|
||||
_mesa_is_winsys_fbo(ctx->DrawBuffer)) {
|
||||
if (flushFront(screen) &&
|
||||
driDrawable &&
|
||||
driDrawable->loaderPrivate) {
|
||||
|
|
|
|||
|
|
@ -71,7 +71,7 @@ nouveau_flush(struct gl_context *ctx, unsigned gallium_flush_flags)
|
|||
|
||||
PUSH_KICK(push);
|
||||
|
||||
if (_mesa_is_winsys_fbo(ctx->DrawBuffer) &&
|
||||
if (ctx->DrawBuffer && _mesa_is_winsys_fbo(ctx->DrawBuffer) &&
|
||||
ctx->DrawBuffer->_ColorDrawBufferIndexes[0] == BUFFER_FRONT_LEFT) {
|
||||
__DRIscreen *screen = nctx->screen->dri_screen;
|
||||
const __DRIdri2LoaderExtension *dri2 = screen->dri2.loader;
|
||||
|
|
|
|||
|
|
@ -544,7 +544,8 @@ void radeonFlush(struct gl_context *ctx, unsigned gallium_flush_flags)
|
|||
rcommonFlushCmdBuf(radeon, __func__);
|
||||
|
||||
flush_front:
|
||||
if (_mesa_is_winsys_fbo(ctx->DrawBuffer) && radeon->front_buffer_dirty) {
|
||||
if (ctx->DrawBuffer && _mesa_is_winsys_fbo(ctx->DrawBuffer) &&
|
||||
radeon->front_buffer_dirty) {
|
||||
__DRIscreen *const screen = radeon->radeonScreen->driScreen;
|
||||
|
||||
if (screen->dri2.loader && (screen->dri2.loader->base.version >= 2)
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue