Marcus Meissner : d3dx9_36: Moved param NULL a bit forward (Coverity).
Alexandre Julliard
julliard at winehq.org
Mon Jun 13 11:49:16 CDT 2011
Module: wine
Branch: master
Commit: 6c902b4201b8237195ef492dae2be70c70793612
URL: http://source.winehq.org/git/wine.git/?a=commit;h=6c902b4201b8237195ef492dae2be70c70793612
Author: Marcus Meissner <marcus at jet.franken.de>
Date: Sat Jun 11 11:00:33 2011 +0200
d3dx9_36: Moved param NULL a bit forward (Coverity).
---
dlls/d3dx9_36/effect.c | 7 ++++++-
1 files changed, 6 insertions(+), 1 deletions(-)
diff --git a/dlls/d3dx9_36/effect.c b/dlls/d3dx9_36/effect.c
index bbe21f0..ca88f76 100644
--- a/dlls/d3dx9_36/effect.c
+++ b/dlls/d3dx9_36/effect.c
@@ -1516,6 +1516,11 @@ static HRESULT WINAPI ID3DXBaseEffectImpl_GetValue(ID3DXBaseEffect *iface, D3DXH
TRACE("iface %p, parameter %p, data %p, bytes %u\n", This, parameter, data, bytes);
if (!param) param = get_parameter_by_name(This, NULL, parameter);
+ if (!param)
+ {
+ WARN("Invalid parameter %p specified\n", parameter);
+ return D3DERR_INVALIDCALL;
+ }
/* samplers don't touch data */
if (param->class == D3DXPC_OBJECT && (param->type == D3DXPT_SAMPLER
@@ -1526,7 +1531,7 @@ static HRESULT WINAPI ID3DXBaseEffectImpl_GetValue(ID3DXBaseEffect *iface, D3DXH
return E_FAIL;
}
- if (data && param && param->bytes <= bytes)
+ if (data && param->bytes <= bytes)
{
TRACE("Type %s\n", debug_d3dxparameter_type(param->type));
More information about the wine-cvs
mailing list