intel/tools/error2aub: Fix potential out of bounds read

Originally the engines size was set to I915_ENGINE_CLASS_VIDEO + 1,
where video was the largest value, and INVALID had a value of -1. Since
then a COMPUTE member was added to the enum, and the INTEL_ENGINE class
moved invalid to the last value.

CID: 1530425
Reviewed-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23384>
This commit is contained in:
Dylan Baker 2023-06-01 15:32:15 -07:00 committed by Marge Bot
parent 39e057028c
commit 9ca0bdba01

View file

@ -285,7 +285,7 @@ main(int argc, char *argv[])
uint32_t ring_buffer_head;
uint32_t ring_buffer_tail;
} instances[3];
} engines[INTEL_ENGINE_CLASS_VIDEO_ENHANCE + 1];
} engines[INTEL_ENGINE_CLASS_INVALID + 1];
memset(engines, 0, sizeof(engines));
int num_ring_bos = 0;