summaryrefslogtreecommitdiff
path: root/src/gallium/tools/trace
diff options
context:
space:
mode:
Diffstat (limited to 'src/gallium/tools/trace')
-rwxr-xr-xsrc/gallium/tools/trace/dump_state.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/gallium/tools/trace/dump_state.py b/src/gallium/tools/trace/dump_state.py
index 5257100da50..bde00ec9996 100755
--- a/src/gallium/tools/trace/dump_state.py
+++ b/src/gallium/tools/trace/dump_state.py
@@ -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)