Henri Verbeet : d3drm: Also validate face indices against the vertex count in load_mesh_data() ( Valgrind).

Alexandre Julliard julliard at wine.codeweavers.com
Mon May 4 07:58:54 CDT 2015


Module: wine
Branch: master
Commit: e723d2a0793b23ad527b681d01ecbb39af757c6b
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=e723d2a0793b23ad527b681d01ecbb39af757c6b

Author: Henri Verbeet <hverbeet at codeweavers.com>
Date:   Mon May  4 13:21:31 2015 +0200

d3drm: Also validate face indices against the vertex count in load_mesh_data() (Valgrind).

---

 dlls/d3drm/meshbuilder.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/dlls/d3drm/meshbuilder.c b/dlls/d3drm/meshbuilder.c
index c24d9dc..8bd5131 100644
--- a/dlls/d3drm/meshbuilder.c
+++ b/dlls/d3drm/meshbuilder.c
@@ -1368,7 +1368,10 @@ HRESULT load_mesh_data(IDirect3DRMMeshBuilder3 *iface, IDirectXFileData *pData,
         if (!This->nb_normals)
         {
             /* Compute face normal */
-            if (nb_face_indexes > 2)
+            if (nb_face_indexes > 2
+                    && faces_vertex_idx_ptr[0] < This->nb_vertices
+                    && faces_vertex_idx_ptr[1] < This->nb_vertices
+                    && faces_vertex_idx_ptr[2] < This->nb_vertices)
             {
                 D3DVECTOR a, b;
 




More information about the wine-cvs mailing list