projects
/
mesa.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
16215a9
)
tools/trace: Handle index buffer overflow gracefully.
author
José Fonseca
<jfonseca@vmware.com>
Fri, 31 Jan 2014 16:44:39 +0000
(16:44 +0000)
committer
José Fonseca
<jfonseca@vmware.com>
Wed, 5 Feb 2014 10:58:38 +0000
(10:58 +0000)
Trivial.
src/gallium/tools/trace/dump_state.py
patch
|
blob
|
history
diff --git
a/src/gallium/tools/trace/dump_state.py
b/src/gallium/tools/trace/dump_state.py
index 5257100da504f5a94b748b86e4c5571167adaa9d..bde00ec9996a15b5218a71361fa39a5692831cbf 100755
(executable)
--- 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)