mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-01-28 01:00:25 +01:00
gallium/hud: prevent a crash if the recording context is inactive
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
This commit is contained in:
parent
37ded08321
commit
9c5b4eb6b4
1 changed files with 4 additions and 1 deletions
|
|
@ -74,7 +74,10 @@ hud_draw_colored_prims(struct hud_context *hud, unsigned prim,
|
|||
struct cso_context *cso = hud->cso;
|
||||
unsigned size = num_vertices * hud->color_prims.vbuf.stride;
|
||||
|
||||
assert(size <= hud->color_prims.buffer_size);
|
||||
/* If a recording context is inactive, don't draw anything. */
|
||||
if (size > hud->color_prims.buffer_size)
|
||||
return;
|
||||
|
||||
memcpy(hud->color_prims.vertices, buffer, size);
|
||||
|
||||
hud->constants.color[0] = r;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue