From 3b30fd9d3a14043dde883e8cf8a72d850dbfa894 Mon Sep 17 00:00:00 2001 From: Christian Costa Date: Tue, 11 Nov 2008 12:39:46 +0100 Subject: [PATCH] d3dxof: Increase max objects and check limit. --- dlls/d3dxof/d3dxof.c | 6 ++++++ dlls/d3dxof/d3dxof_private.h | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/dlls/d3dxof/d3dxof.c b/dlls/d3dxof/d3dxof.c index 42149c9c37f..1c3c99bcd14 100644 --- a/dlls/d3dxof/d3dxof.c +++ b/dlls/d3dxof/d3dxof.c @@ -2077,6 +2077,12 @@ static HRESULT WINAPI IDirectXFileEnumObjectImpl_GetNextDataObject(IDirectXFileE TRACE("(%p/%p)->(%p)\n", This, iface, ppDataObj); + if (This->nb_xobjects >= MAX_OBJECTS) + { + ERR("Too many objects\n"); + return DXFILEERR_NOMOREOBJECTS; + } + if (!This->buf.rem_bytes) return DXFILEERR_NOMOREOBJECTS; diff --git a/dlls/d3dxof/d3dxof_private.h b/dlls/d3dxof/d3dxof_private.h index f70eb67d317..80f67a297c9 100644 --- a/dlls/d3dxof/d3dxof_private.h +++ b/dlls/d3dxof/d3dxof_private.h @@ -38,7 +38,7 @@ #define MAX_MEMBERS 50 #define MAX_CHILDS 20 #define MAX_TEMPLATES 200 -#define MAX_OBJECTS 200 +#define MAX_OBJECTS 500 #define MAX_SUBOBJECTS 120 #define MAX_STRINGS_BUFFER 200