Christian Costa : d3dxof: Increase max childs/ subobjects and check the limit is not overcome.

Alexandre Julliard julliard at winehq.org
Mon Nov 10 07:43:53 CST 2008


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

Author: Christian Costa <titan.costa at wanadoo.fr>
Date:   Sun Nov  9 11:10:56 2008 +0100

d3dxof: Increase max childs/subobjects and check the limit is not overcome.

---

 dlls/d3dxof/d3dxof.c         |   11 +++++++++++
 dlls/d3dxof/d3dxof_private.h |    4 ++--
 2 files changed, 13 insertions(+), 2 deletions(-)

diff --git a/dlls/d3dxof/d3dxof.c b/dlls/d3dxof/d3dxof.c
index 1939482..d55d2be 100644
--- a/dlls/d3dxof/d3dxof.c
+++ b/dlls/d3dxof/d3dxof.c
@@ -1989,6 +1989,12 @@ _exit:
     }
   }
 
+  if (buf->pxo->nb_childs > MAX_CHILDS)
+  {
+    FIXME("Too many childs %d\n", buf->pxo->nb_childs);
+    return FALSE;
+  }
+
   return TRUE;
 }
 
@@ -2094,6 +2100,11 @@ static HRESULT WINAPI IDirectXFileEnumObjectImpl_GetNextDataObject(IDirectXFileE
   }
 
   This->buf.pxo->nb_subobjects = This->buf.cur_subobject;
+  if (This->buf.cur_subobject > MAX_SUBOBJECTS)
+  {
+    FIXME("Too many suobjects %d\n", This->buf.cur_subobject);
+    return DXFILEERR_BADALLOC;
+  }
 
   object->pobj = This->buf.pxo;
   object->cur_enum_object = 0;
diff --git a/dlls/d3dxof/d3dxof_private.h b/dlls/d3dxof/d3dxof_private.h
index ba403df..4d8716c 100644
--- a/dlls/d3dxof/d3dxof_private.h
+++ b/dlls/d3dxof/d3dxof_private.h
@@ -36,10 +36,10 @@
 #define MAX_NAME_LEN 32
 #define MAX_ARRAY_DIM 1
 #define MAX_MEMBERS 50
-#define MAX_CHILDS 10
+#define MAX_CHILDS 20
 #define MAX_TEMPLATES 200
 #define MAX_OBJECTS 200
-#define MAX_SUBOBJECTS 20
+#define MAX_SUBOBJECTS 120
 
 typedef struct {
     DWORD type;




More information about the wine-cvs mailing list