[Mesa-dev] [PATCH 3/4] st_cb_bitmap: check NULL return from u_upload_alloc

Julien Isorce julien.isorce at gmail.com
Fri Mar 24 11:08:12 UTC 2017


Signed-off-by: Julien Isorce <jisorce at oblong.com>
---
 src/mesa/state_tracker/st_cb_bitmap.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/src/mesa/state_tracker/st_cb_bitmap.c b/src/mesa/state_tracker/st_cb_bitmap.c
index b2e2608..3ce190e 100644
--- a/src/mesa/state_tracker/st_cb_bitmap.c
+++ b/src/mesa/state_tracker/st_cb_bitmap.c
@@ -720,6 +720,11 @@ st_DrawAtlasBitmaps(struct gl_context *ctx,
    u_upload_alloc(pipe->stream_uploader, 0, num_vert_bytes, 4,
                   &vb.buffer_offset, &vb.buffer, (void **) &verts);
 
+   if (unlikely(!verts)) {
+      _mesa_error(ctx, GL_OUT_OF_MEMORY, "glCallLists(bitmap text)");
+      return;
+   }
+
    /* build quads vertex data */
    for (i = 0; i < count; i++) {
       const GLfloat epsilon = 0.0001F;
-- 
2.7.4



More information about the mesa-dev mailing list