[Mesa-dev] [PATCH] st/mesa: properly handle u_upload_alloc failure

Ilia Mirkin imirkin at alum.mit.edu
Sat Sep 5 10:12:16 PDT 2015


vbuf is never null. We want to make sure that a resource was allocated
for the vbuf, which is *vbuf.

Signed-off-by: Ilia Mirkin <imirkin at alum.mit.edu>
---
 src/mesa/state_tracker/st_cb_bitmap.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/mesa/state_tracker/st_cb_bitmap.c b/src/mesa/state_tracker/st_cb_bitmap.c
index ce593a9..230eba8 100644
--- a/src/mesa/state_tracker/st_cb_bitmap.c
+++ b/src/mesa/state_tracker/st_cb_bitmap.c
@@ -351,7 +351,7 @@ setup_bitmap_vertex_data(struct st_context *st, bool normalized,
 
    u_upload_alloc(st->uploader, 0, 4 * sizeof(vertices[0]),
                   vbuf_offset, vbuf, (void **) &vertices);
-   if (!vbuf) {
+   if (!*vbuf) {
       return;
    }
 
-- 
2.4.6



More information about the mesa-dev mailing list