From: José Fonseca Date: Fri, 31 Jan 2014 16:44:39 +0000 (+0000) Subject: tools/trace: Handle index buffer overflow gracefully. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=5c975966dcaaa4e781f3baba0fc1e3b7ad4a18a6;p=mesa.git tools/trace: Handle index buffer overflow gracefully. Trivial. --- 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)