[PATCH 5/5] wined3d: Check for a valid index buffer in d3d[89]_device_DrawIndexedPrimitive(UP).

Henri Verbeet hverbeet at gmail.com
Tue Mar 30 08:42:01 CDT 2021


On Sat, 27 Mar 2021 at 20:34, Zebediah Figura <z.figura12 at gmail.com> wrote:
> @@ -2698,6 +2703,13 @@ static HRESULT WINAPI d3d8_device_DrawIndexedPrimitiveUP(IDirect3DDevice8 *iface
>
>      wined3d_mutex_lock();
>
> +    if (!device->stateblock_state->index_buffer)
> +    {
> +        wined3d_mutex_unlock();
> +        WARN("Index buffer not set, returning D3D_OK.\n");
> +        return D3D_OK;
> +    }
> +
That's wrong; d3d8_device_DrawIndexedPrimitiveUP() uses the indices
passed as "index_data", not the currently bound index buffer.

> @@ -3267,6 +3271,13 @@ static HRESULT WINAPI d3d9_device_DrawIndexedPrimitiveUP(IDirect3DDevice9Ex *ifa
>          return D3DERR_INVALIDCALL;
>      }
>
> +    if (!device->stateblock_state->index_buffer)
> +    {
> +        wined3d_mutex_unlock();
> +        WARN("Called without a valid index buffer set.\n");
> +        return D3DERR_INVALIDCALL;
> +    }
> +
Likewise.



More information about the wine-devel mailing list