mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-05 07:28:11 +02:00
gallium/osmesa: fix buffer resizing
Generate a new buffer if OSMesaMakeCurrent is called with a new size
Fix a use-after-free error when the old buffer is destroyed
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/5276
Fixes: 26c6f6cfbb ("gallium/osmesa: Remove the broken buffer-reuse scheme.")
Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12685>
This commit is contained in:
parent
3b289c9f30
commit
eed660221b
1 changed files with 4 additions and 1 deletions
|
|
@ -781,8 +781,11 @@ OSMesaMakeCurrent(OSMesaContext osmesa, void *buffer, GLenum type,
|
|||
if (osmesa->current_buffer &&
|
||||
(osmesa->current_buffer->visual.color_format != color_format ||
|
||||
osmesa->current_buffer->visual.depth_stencil_format != osmesa->depth_stencil_format ||
|
||||
osmesa->current_buffer->visual.accum_format != osmesa->accum_format)) {
|
||||
osmesa->current_buffer->visual.accum_format != osmesa->accum_format ||
|
||||
osmesa->current_buffer->width != width ||
|
||||
osmesa->current_buffer->height != height)) {
|
||||
osmesa_destroy_buffer(osmesa->current_buffer);
|
||||
osmesa->current_buffer = NULL;
|
||||
}
|
||||
|
||||
if (!osmesa->current_buffer) {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue