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

This commit is contained in:
Christian Costa 2008-11-09 11:10:56 +01:00 committed by Alexandre Julliard
parent b46b75170e
commit e4748c3ca3
2 changed files with 13 additions and 2 deletions

View File

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

View File

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