Commit 0e35782f authored by Józef Kucia's avatar Józef Kucia Committed by Alexandre Julliard

wined3d: Validate byte code pointer in shader_init().

parent 7c903618
......@@ -3699,6 +3699,9 @@ static HRESULT shader_init(struct wined3d_shader *shader, struct wined3d_device
TRACE("byte_code %p, byte_code_size %#lx, format %#x.\n",
desc->byte_code, (long)desc->byte_code_size, desc->format);
if (!desc->byte_code)
return WINED3DERR_INVALIDCALL;
if (!(shader->frontend = shader_select_frontend(desc->format)))
{
FIXME("Unable to find frontend for shader.\n");
......@@ -4251,9 +4254,6 @@ HRESULT CDECL wined3d_shader_create_cs(struct wined3d_device *device, const stru
TRACE("device %p, desc %p, parent %p, parent_ops %p, shader %p.\n",
device, desc, parent, parent_ops, shader);
if (!desc->byte_code)
return WINED3DERR_INVALIDCALL;
if (!(object = heap_alloc_zero(sizeof(*object))))
return E_OUTOFMEMORY;
......@@ -4288,9 +4288,6 @@ HRESULT CDECL wined3d_shader_create_ds(struct wined3d_device *device, const stru
TRACE("device %p, desc %p, parent %p, parent_ops %p, shader %p.\n",
device, desc, parent, parent_ops, shader);
if (!desc->byte_code)
return WINED3DERR_INVALIDCALL;
if (!(object = heap_alloc_zero(sizeof(*object))))
return E_OUTOFMEMORY;
......@@ -4326,9 +4323,6 @@ HRESULT CDECL wined3d_shader_create_gs(struct wined3d_device *device, const stru
TRACE("device %p, desc %p, so_desc %p, parent %p, parent_ops %p, shader %p.\n",
device, desc, so_desc, parent, parent_ops, shader);
if (!desc->byte_code)
return WINED3DERR_INVALIDCALL;
if (!(object = heap_alloc_zero(sizeof(*object))))
return E_OUTOFMEMORY;
......@@ -4356,9 +4350,6 @@ HRESULT CDECL wined3d_shader_create_hs(struct wined3d_device *device, const stru
TRACE("device %p, desc %p, parent %p, parent_ops %p, shader %p.\n",
device, desc, parent, parent_ops, shader);
if (!desc->byte_code)
return WINED3DERR_INVALIDCALL;
if (!(object = heap_alloc_zero(sizeof(*object))))
return E_OUTOFMEMORY;
......@@ -4393,9 +4384,6 @@ HRESULT CDECL wined3d_shader_create_ps(struct wined3d_device *device, const stru
TRACE("device %p, desc %p, parent %p, parent_ops %p, shader %p.\n",
device, desc, parent, parent_ops, shader);
if (!desc->byte_code)
return WINED3DERR_INVALIDCALL;
if (!(object = heap_alloc_zero(sizeof(*object))))
return E_OUTOFMEMORY;
......@@ -4423,9 +4411,6 @@ HRESULT CDECL wined3d_shader_create_vs(struct wined3d_device *device, const stru
TRACE("device %p, desc %p, parent %p, parent_ops %p, shader %p.\n",
device, desc, parent, parent_ops, shader);
if (!desc->byte_code)
return WINED3DERR_INVALIDCALL;
if (!(object = heap_alloc_zero(sizeof(*object))))
return E_OUTOFMEMORY;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment