gallium/tgsi: fix oob access in parse instruction
authorLi Qiang <liq3ea@gmail.com>
Mon, 23 Jan 2017 07:44:03 +0000 (02:44 -0500)
committerDave Airlie <airlied@redhat.com>
Tue, 7 Feb 2017 04:00:04 +0000 (14:00 +1000)
commit83fb63d31de51cd49a947f68393672e97b307f37
treeec48db63c7c2b643343b1150091e36d904fd604f
parentce8a63de6dffd4a7bc704b63bdd48a63798a438e
gallium/tgsi: fix oob access in parse instruction

When parsing texture instruction, it doesn't stop if the
'cur' is ',', the loop variable 'i' will also be increased
and be used to index the 'inst.TexOffsets' array. This can lead
an oob access issue. This patch avoid this.

Reviewed-by: Dave Airlie <airlied@redhat.com>
Signed-off-by: Li Qiang <liq3ea@gmail.com>
src/gallium/auxiliary/tgsi/tgsi_text.c