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

oldstable
Henri Verbeet 2015-05-04 13:21:31 +02:00 committed by Alexandre Julliard
parent fdd22f197a
commit e723d2a079
1 changed files with 4 additions and 1 deletions

View File

@ -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;