<div dir="ltr">Hello,<div><br></div><div>Ping!<br><div class="gmail_extra"><br><div class="gmail_quote">2017-01-23 15:44 GMT+08:00 Li Qiang <span dir="ltr"><<a href="mailto:liq3ea@gmail.com" target="_blank">liq3ea@gmail.com</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">When parsing texture instruction, it doesn't stop if the<br>
'cur' is ',', the loop variable 'i' will also be increased<br>
and be used to index the 'inst.TexOffsets' array. This can lead<br>
an oob access issue. This patch avoid this.<br>
<br>
Signed-off-by: Li Qiang <<a href="mailto:liq3ea@gmail.com">liq3ea@gmail.com</a>><br>
---<br>
 src/gallium/auxiliary/tgsi/<wbr>tgsi_text.c | 2 +-<br>
 1 file changed, 1 insertion(+), 1 deletion(-)<br>
<br>
diff --git a/src/gallium/auxiliary/tgsi/<wbr>tgsi_text.c b/src/gallium/auxiliary/tgsi/<wbr>tgsi_text.c<br>
index 308e6b5..4ed9050 100644<br>
--- a/src/gallium/auxiliary/tgsi/<wbr>tgsi_text.c<br>
+++ b/src/gallium/auxiliary/tgsi/<wbr>tgsi_text.c<br>
@@ -1163,7 +1163,7 @@ parse_instruction(<br>
<br>
    cur = ctx->cur;<br>
    eat_opt_white( &cur );<br>
-   for (i = 0; inst.Instruction.Texture && *cur == ','; i++) {<br>
+   for (i = 0; inst.Instruction.Texture && *cur == ',' && i < TGSI_FULL_MAX_TEX_OFFSETS; i++) {<br>
          cur++;<br>
          eat_opt_white( &cur );<br>
          ctx->cur = cur;<br>
<span class="HOEnZb"><font color="#888888">--<br>
2.7.4<br>
<br>
</font></span></blockquote></div><br></div></div></div>