OSDN Git Service

gallium/radeon: handle buffer alloc failures in r600_draw_rectangle
authorMarek Olšák <marek.olsak@amd.com>
Thu, 10 Sep 2015 15:54:41 +0000 (17:54 +0200)
committerEmil Velikov <emil.l.velikov@gmail.com>
Wed, 7 Oct 2015 13:09:11 +0000 (14:09 +0100)
Cc: 11.0 <mesa-stable@lists.freedesktop.org>
Acked-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
(cherry picked from commit f95e695059c428a21a1e1a27d5cd5ccce2a97b0e)

src/gallium/drivers/radeon/r600_pipe_common.c

index ed5d1da..f0fb4af 100644 (file)
@@ -78,6 +78,9 @@ void r600_draw_rectangle(struct blitter_context *blitter,
         * I guess the 4th one is derived from the first 3.
         * The vertex specification should match u_blitter's vertex element state. */
        u_upload_alloc(rctx->uploader, 0, sizeof(float) * 24, &offset, &buf, (void**)&vb);
+       if (!buf)
+               return;
+
        vb[0] = x1;
        vb[1] = y1;
        vb[2] = depth;