st/mesa: Initialize textures array in st_framebuffer_validate
authorMichel Dänzer <michel.daenzer@amd.com>
Mon, 16 Oct 2017 14:35:18 +0000 (16:35 +0200)
committerMichel Dänzer <michel@daenzer.net>
Wed, 18 Oct 2017 16:28:00 +0000 (18:28 +0200)
commit7561da367baeb49c848dc49b65e252deb6428422
treeb8cb6f3be16db6fe2bef58958fafde9d7663d39b
parent47273d7312cb5b5b6b0b9faa814d574bbbce1c01
st/mesa: Initialize textures array in st_framebuffer_validate

And just reference pipe_resources to it in the validate callbacks.

Avoids pipe_resource leaks when st_framebuffer_validate ends up calling
the validate callback multiple times, e.g. when a window is resized.

v2:
* Use generic stable tag instead of Fixes: tag, since the problem could
  already happen before the commit referenced in v1 (Thomas Hellstrom)
* Use memset to initialize the array on the stack instead of allocating
  the array with os_calloc.

Cc: mesa-stable@lists.freedesktop.org
Reviewed-by: Thomas Hellstrom <thellstrom@vmware.com>
src/gallium/state_trackers/dri/dri_drawable.c
src/gallium/state_trackers/glx/xlib/xm_st.c
src/gallium/state_trackers/hgl/hgl.c
src/gallium/state_trackers/osmesa/osmesa.c
src/gallium/state_trackers/wgl/stw_st.c
src/mesa/state_tracker/st_manager.c