i915: Prevent invalid framebuffer usage

When a surfaceless context is in use, driDrawablePriv might be NULL, so needs to
be checked before calling dri2InvalidateDrawable. Same for read calls.

Reviewed-by: Adam Jackson <ajax@redhat.com>
Reviewed-by: Eleni Maria Stea <estea@igalia.com>

Closes https://gitlab.freedesktop.org/mesa/mesa/-/issues/778

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11459>
This commit is contained in:
Philippe Normand
2021-04-11 13:27:56 +01:00
committed by Marge Bot
parent 40b1668ebd
commit 6a0c0d0da9
+4 -2
View File
@@ -62,7 +62,8 @@ intelDrawBuffer(struct gl_context * ctx)
* time, invalidate our DRI drawable so we'll ask for new buffers
* (including the fake front) before we start rendering again.
*/
dri2InvalidateDrawable(intel->driContext->driDrawablePriv);
if (intel->driContext->driDrawablePriv)
dri2InvalidateDrawable(intel->driContext->driDrawablePriv);
}
intel_draw_buffer(ctx);
@@ -79,7 +80,8 @@ intelReadBuffer(struct gl_context * ctx, GLenum mode)
* time, invalidate our DRI drawable so we'll ask for new buffers
* (including the fake front) before we start reading again.
*/
dri2InvalidateDrawable(intel->driContext->driReadablePriv);
if (intel->driContext->driReadablePriv)
dri2InvalidateDrawable(intel->driContext->driReadablePriv);
}
}