[virglrenderer-devel] [PATCH v2 1/4] protect call to glPrimitiveRestartIndex

Erik Faye-Lund erik.faye-lund at collabora.com
Fri Jul 20 08:03:40 UTC 2018


Otherwise, it'd be possible to generate evil commands from a rouge
guest-driver that can crash the VM.

Signed-off-by: Erik Faye-Lund <erik.faye-lund at collabora.com>
---
 src/vrend_renderer.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/vrend_renderer.c b/src/vrend_renderer.c
index 4086abd..78aa252 100644
--- a/src/vrend_renderer.c
+++ b/src/vrend_renderer.c
@@ -3430,7 +3430,7 @@ void vrend_draw_vbo(struct vrend_context *ctx,
       } else if (vrend_state.have_nv_prim_restart) {
          glEnableClientState(GL_PRIMITIVE_RESTART_NV);
          glPrimitiveRestartIndexNV(info->restart_index);
-      } else {
+      } else if (vrend_state.have_gl_prim_restart) {
          glEnable(GL_PRIMITIVE_RESTART);
          glPrimitiveRestartIndex(info->restart_index);
       }
-- 
2.18.0



More information about the virglrenderer-devel mailing list