Commit 5f4fc0a9 authored by Józef Kucia's avatar Józef Kucia Committed by Alexandre Julliard

wined3d: Forbid creating SRVs with level or layer count equal to 0.

parent b44b0690
...@@ -298,8 +298,10 @@ static HRESULT wined3d_shader_resource_view_init(struct wined3d_shader_resource_ ...@@ -298,8 +298,10 @@ static HRESULT wined3d_shader_resource_view_init(struct wined3d_shader_resource_
struct wined3d_texture *texture = texture_from_resource(resource); struct wined3d_texture *texture = texture_from_resource(resource);
unsigned int i; unsigned int i;
if (desc->u.texture.level_idx >= texture->level_count if (!desc->u.texture.level_count
|| desc->u.texture.level_idx >= texture->level_count
|| desc->u.texture.level_count > texture->level_count - desc->u.texture.level_idx || desc->u.texture.level_count > texture->level_count - desc->u.texture.level_idx
|| !desc->u.texture.layer_count
|| desc->u.texture.layer_idx >= texture->layer_count || desc->u.texture.layer_idx >= texture->layer_count
|| desc->u.texture.layer_count > texture->layer_count - desc->u.texture.layer_idx) || desc->u.texture.layer_count > texture->layer_count - desc->u.texture.layer_idx)
return E_INVALIDARG; return E_INVALIDARG;
......
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