[PATCH 1/5] gdiplus: Refactor to split up encode_image_wic().
Vincent Povirk (they/them)
vincent at codeweavers.com
Mon Feb 17 11:33:46 CST 2020
> +GpStatus terminate_encoder_wic(IWICBitmapEncoder *encoder)
> +{
> + HRESULT hr = IWICBitmapEncoder_Commit(encoder);
> + IWICBitmapEncoder_Release(encoder);
> + return hresult_to_status(hr);
> +}
I don't like having the Release call separated from clearing or
freeing the stored reference to the interface. I think we're likely to
miss a use-after-free this way.
I'd suggest either making this function take a GpImage* so we can
clear the reference, or moving the Release call out of it.
More information about the wine-devel
mailing list