mesa: add bounds checking to eliminate buffer overrun
authorCourtney Goeltzenleuchter <courtney@lunarg.com>
Tue, 8 Apr 2014 15:10:09 +0000 (09:10 -0600)
committerKenneth Graunke <kenneth@whitecape.org>
Tue, 8 Apr 2014 19:55:25 +0000 (12:55 -0700)
commitcb4ad1368551b64756c7b6e2007588e34739b188
tree17abe7cb78c0a3aac1344980114acd7e28b59116
parenta22d944fdb353c5b0f8e5fc73b6014db95cfe104
mesa: add bounds checking to eliminate buffer overrun

Decompressing ETC2 textures was causing intermitent segfault
by copying resulting 4x4 texel block to the destination texture
regardless of the size of the destination texture. Issue found
via application crash in GLBenchmark 3.0's Manhattan test.

v2: add more detail comment. Compute limit outside inner loops.
v3: add bugzilla reference
v4: Correct cc syntax in commit log
v5: really grab the right patch

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=74988
Cc: "9.2 10.0 10.1" <mesa-stable@lists.freedesktop.org>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com> [v1, suggested v2-3]
src/mesa/main/texcompress_etc.c