[PATCH 5/5] d3dx9: Correctly handle out of memory conditions while reallocating children array.

Henri Verbeet hverbeet at gmail.com
Tue Aug 26 09:30:39 CDT 2014


On 26 August 2014 16:13, Matteo Bruni <mbruni at codeweavers.com> wrote:
> @@ -338,15 +338,20 @@ static HRESULT d3dx9_file_data_create(IDirectXFileObject *dxfile_object, ID3DXFi
>
>      while (SUCCEEDED(ret = IDirectXFileData_GetNextObject(object->dxfile_data, &data_object)))
...
> +            new_children = HeapReAlloc(GetProcessHeap(), 0, object->children,
> +                    sizeof(*object->children) * (object->nb_children + 1));
While I suspect this is hardly the only thing wrong with xfile.c, it
seems suboptimal to grow the array by 1 each time you go through the
loop.



More information about the wine-devel mailing list