WINED3D: Fix a possible null dereference.

H. Verbeet hverbeet at gmail.com
Sat Apr 19 05:05:31 CDT 2008


On 19/04/2008, David Adam <david.adam.cnrs at gmail.com> wrote:
> The Sting Demo calls the function
> IDirect3DDeviceImpl_7_SetMaterial (in ddraw/device.c) with
> Mat=NULL.
> Then, this makes the function IWineD3DDeviceImpl_SetMaterial (in
> wined3d/device.c) crashes in the line
> This->updateStateBlock->material = *pMaterial;
>  So, the patch checks is the material is not null before  assignating it.
>
> This fixes a crash in The Sting demo.
>
> David Adam
>
I would like to see a few tests that prove this is the correct
behaviour (instead of eg. simply returning WINED3DERR_INVALIDCALL),
for ddraw, d3d8 and d3d9.



More information about the wine-patches mailing list