mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-05 13:58:04 +02:00
tools/trace: Handle index buffer overflow gracefully.
Trivial.
This commit is contained in:
parent
16215a9723
commit
5c975966dc
1 changed files with 4 additions and 1 deletions
|
|
@ -474,7 +474,10 @@ class Context(Dispatcher):
|
|||
indices = []
|
||||
for i in xrange(info.start, info.start + count):
|
||||
offset = self._state.index_buffer.offset + i*index_size
|
||||
index, = unpack_from(format, data, offset)
|
||||
if offset + index_size > len(data):
|
||||
index = 0
|
||||
else:
|
||||
index, = unpack_from(format, data, offset)
|
||||
indices.append(index)
|
||||
min_index = min(min_index, index)
|
||||
max_index = max(max_index, index)
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue