diff --git a/src/gallium/auxiliary/util/u_threaded_context.c b/src/gallium/auxiliary/util/u_threaded_context.c index c5029c6126a..a6e16370d0c 100644 --- a/src/gallium/auxiliary/util/u_threaded_context.c +++ b/src/gallium/auxiliary/util/u_threaded_context.c @@ -121,7 +121,7 @@ static void tc_batch_renderpass_infos_resize(struct threaded_context *tc, struct tc_batch *batch) { unsigned size = batch->renderpass_infos.capacity; - unsigned cur_num = batch->renderpass_info_idx; + unsigned cur_num = MAX2(batch->renderpass_info_idx, 0); if (size / sizeof(struct tc_renderpass_info) > cur_num) return;