From 607c76a165c7c948f87c33052abb16c146b7ae65 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rico=20Sch=C3=BCller?= Date: Sat, 18 Aug 2012 14:58:52 +0200 Subject: [PATCH] d3dx9: Improve check for empty braces for elements. --- dlls/d3dx9_36/effect.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/dlls/d3dx9_36/effect.c b/dlls/d3dx9_36/effect.c index 2a0b01c1994..dec2f77c287 100644 --- a/dlls/d3dx9_36/effect.c +++ b/dlls/d3dx9_36/effect.c @@ -975,7 +975,8 @@ static struct d3dx_parameter *get_parameter_element_by_name(struct d3dx_paramete element = atoi(name); part = strchr(name, ']') + 1; - if (parameter->element_count > element) + /* check for empty [] && element range */ + if ((part - name) > 1 && parameter->element_count > element) { temp_parameter = get_parameter_struct(parameter->member_handles[element]);