Signed-off-by: Ziqing Hui zhui@codeweavers.com ---
v3: AddRef before Release. Reduce indentation.
dlls/d2d1/effect.c | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-)
diff --git a/dlls/d2d1/effect.c b/dlls/d2d1/effect.c index a07ea34c4e2..768777d3652 100644 --- a/dlls/d2d1/effect.c +++ b/dlls/d2d1/effect.c @@ -27,6 +27,16 @@ static inline struct d2d_effect *impl_from_ID2D1Effect(ID2D1Effect *iface)
static void d2d_effect_cleanup(struct d2d_effect *effect) { + unsigned int i; + + if (effect->inputs) + { + for (i = 0; i < effect->input_count; ++i) + { + if (effect->inputs[i]) + ID2D1Image_Release(effect->inputs[i]); + } + } heap_free(effect->inputs); ID2D1Factory_Release(effect->factory); } @@ -172,7 +182,17 @@ static HRESULT STDMETHODCALLTYPE d2d_effect_GetSubProperties(ID2D1Effect *iface,
static void STDMETHODCALLTYPE d2d_effect_SetInput(ID2D1Effect *iface, UINT32 index, ID2D1Image *input, BOOL invalidate) { - FIXME("iface %p, index %u, input %p, invalidate %d stub!\n", iface, index, input, invalidate); + struct d2d_effect *effect = impl_from_ID2D1Effect(iface); + + TRACE("iface %p, index %u, input %p, invalidate %d.\n", iface, index, input, invalidate); + + if (index >= effect->input_count) + return; + + ID2D1Image_AddRef(input); + if (effect->inputs[index]) + ID2D1Image_Release(effect->inputs[index]); + effect->inputs[index] = input; }
static HRESULT STDMETHODCALLTYPE d2d_effect_SetInputCount(ID2D1Effect *iface, UINT32 count)