vc4: Fix a potential src buffer overflow in shader rec validation.
authorEric Anholt <eric@anholt.net>
Thu, 31 Jul 2014 20:14:00 +0000 (13:14 -0700)
committerEric Anholt <eric@anholt.net>
Mon, 11 Aug 2014 21:45:31 +0000 (14:45 -0700)
src/gallium/drivers/vc4/vc4_simulator_validate.c

index 855947395e9332cbbcf3038b49232b9d37c7acc3..e16b3728eaca1fd170fbc360b948a012f40065f9 100644 (file)
@@ -462,6 +462,7 @@ validate_shader_rec(struct drm_device *dev,
        memcpy(pkt_v, pkt_u, packet_size);
        exec->shader_rec_u += packet_size;
        exec->shader_rec_v += packet_size;
+       exec->shader_rec_size -= packet_size;
 
        for (i = 0; i < nr_relocs; i++) {
                if (src_handles[i] >= exec->bo_count) {