<div dir="ltr">Sorry, I didn't switch the git branch, I will resend another.<div><br></div><div>Thanks.</div></div><div class="gmail_extra"><br><div class="gmail_quote">2017-02-25 19:03 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">From: Li Qiang <<a href="mailto:liq3ea@gmail.com">liq3ea@gmail.com</a>><br>
<br>
Free the vertex array in error path.<br>
This was introduced by this commit:<br>
renderer: fix heap overflow in vertex elements state create.<br>
<br>
Signed-off-by: Li Qiang <<a href="mailto:liq3ea@gmail.com">liq3ea@gmail.com</a>><br>
---<br>
src/vrend_renderer.c | 4 +++-<br>
tests/test_virgl_cmd.c | 10 +++++-----<br>
2 files changed, 8 insertions(+), 6 deletions(-)<br>
<br>
diff --git a/src/vrend_renderer.c b/src/vrend_renderer.c<br>
index 1bca7ad..7c2053f 100644<br>
--- a/src/vrend_renderer.c<br>
+++ b/src/vrend_renderer.c<br>
@@ -1657,8 +1657,10 @@ int vrend_create_vertex_elements_<wbr>state(struct vrend_context *ctx,<br>
if (!v)<br>
return ENOMEM;<br>
<br>
- if (num_elements > PIPE_MAX_ATTRIBS)<br>
+ if (num_elements > PIPE_MAX_ATTRIBS) {<br>
+ FREE(v)<br>
return EINVAL;<br>
+ }<br>
<br>
v->count = num_elements;<br>
for (i = 0; i < num_elements; i++) {<br>
diff --git a/tests/test_virgl_cmd.c b/tests/test_virgl_cmd.c<br>
index b342e85..a993471 100644<br>
--- a/tests/test_virgl_cmd.c<br>
+++ b/tests/test_virgl_cmd.c<br>
@@ -1014,13 +1014,13 @@ static Suite *virgl_init_suite(void)<br>
<br>
s = suite_create("virgl_clear");<br>
tc_core = tcase_create("clear");<br>
- tcase_add_test(tc_core, virgl_test_clear);<br>
+// tcase_add_test(tc_core, virgl_test_clear);<br>
tcase_add_test(tc_core, virgl_test_blit_simple);<br>
tcase_add_test(tc_core, virgl_test_overlap_obj_id);<br>
- tcase_add_test(tc_core, virgl_test_large_shader);<br>
- tcase_add_test(tc_core, virgl_test_render_simple);<br>
- tcase_add_test(tc_core, virgl_test_render_geom_simple)<wbr>;<br>
- tcase_add_test(tc_core, virgl_test_render_xfb);<br>
+// tcase_add_test(tc_core, virgl_test_large_shader);<br>
+// tcase_add_test(tc_core, virgl_test_render_simple);<br>
+// tcase_add_test(tc_core, virgl_test_render_geom_simple)<wbr>;<br>
+// tcase_add_test(tc_core, virgl_test_render_xfb);<br>
<br>
suite_add_tcase(s, tc_core);<br>
return s;<br>
<span class="HOEnZb"><font color="#888888">--<br>
2.7.4<br>
<br>
</font></span></blockquote></div><br></div>