Module: Mesa
Branch: master
Commit: 239bae7b942dc900b3768e42b96580dc4f85068a
URL:    
http://cgit.freedesktop.org/mesa/mesa/commit/?id=239bae7b942dc900b3768e42b96580dc4f85068a

Author: Eric Anholt <[email protected]>
Date:   Tue Nov 17 12:40:26 2020 -0800

freedreno: Fix warning about uninit size for the size==0 special case.

The size==0 query case would have just used uninitialized stack data for
sizing its BOs.

Fixes: 536ec9d7f5ab ("freedreno: Refactor fd_resource_create_with_modifiers() 
into a helper")
Reviewed-by: Rob Clark <[email protected]>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7664>

---

 src/gallium/drivers/freedreno/freedreno_resource.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/src/gallium/drivers/freedreno/freedreno_resource.c 
b/src/gallium/drivers/freedreno/freedreno_resource.c
index ae0877229f4..15273842985 100644
--- a/src/gallium/drivers/freedreno/freedreno_resource.c
+++ b/src/gallium/drivers/freedreno/freedreno_resource.c
@@ -977,6 +977,7 @@ fd_resource_allocate_and_resolve(struct pipe_screen 
*pscreen,
        if (size == 0) {
                /* note, semi-intention == instead of & */
                debug_assert(prsc->bind == PIPE_BIND_QUERY_BUFFER);
+               *psize = 0;
                return prsc;
        }
 

_______________________________________________
mesa-commit mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/mesa-commit

Reply via email to