mirror of
git://source.winehq.org/git/wine.git
synced 2024-11-01 08:13:18 +00:00
wined3d: Forbid creating SRVs with level or layer count equal to 0.
Signed-off-by: Józef Kucia <jkucia@codeweavers.com> Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
b44b0690d3
commit
5f4fc0a937
1 changed files with 3 additions and 1 deletions
|
@ -298,8 +298,10 @@ static HRESULT wined3d_shader_resource_view_init(struct wined3d_shader_resource_
|
|||
struct wined3d_texture *texture = texture_from_resource(resource);
|
||||
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.layer_count
|
||||
|| desc->u.texture.layer_idx >= texture->layer_count
|
||||
|| desc->u.texture.layer_count > texture->layer_count - desc->u.texture.layer_idx)
|
||||
return E_INVALIDARG;
|
||||
|
|
Loading…
Reference in a new issue