[PATCH v2 0/1] MR5958: d3dx9_36: Remove superflous nullcheck (coverity)
Since we return when the factory creation fails, it can't be null here -- v2: d3dx9: Remove superflous nullcheck (coverity). https://gitlab.winehq.org/wine/wine/-/merge_requests/5958
From: Fabian Maurer <dark.shadow4(a)web.de> Since we return when the factory creation fails, it can't be null here --- dlls/d3dx9_36/surface.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/dlls/d3dx9_36/surface.c b/dlls/d3dx9_36/surface.c index 3e0b880eec4..f918d59fd19 100644 --- a/dlls/d3dx9_36/surface.c +++ b/dlls/d3dx9_36/surface.c @@ -1002,7 +1002,7 @@ static HRESULT d3dx_initialize_image_from_wic(const void *src_data, uint32_t src IWICBitmapFrameDecode *bitmap_frame = NULL; IWICBitmapDecoder *bitmap_decoder = NULL; uint32_t src_image_size = src_data_size; - IWICImagingFactory *wic_factory = NULL; + IWICImagingFactory *wic_factory; const void *src_image = src_data; WICPixelFormatGUID pixel_format; IWICStream *wic_stream = NULL; @@ -1102,8 +1102,7 @@ exit: IWICBitmapDecoder_Release(bitmap_decoder); if (wic_stream) IWICStream_Release(wic_stream); - if (wic_factory) - IWICImagingFactory_Release(wic_factory); + IWICImagingFactory_Release(wic_factory); return hr; } -- GitLab https://gitlab.winehq.org/wine/wine/-/merge_requests/5958
On Thu Jul 4 21:58:56 2024 +0000, Matteo Bruni wrote:
Patch seems correct but I have a couple of nits: - you can now get rid of the `wic_factory` initialization at the top of the function - please use "d3dx9:" as the subject prefix Thanks for the MR! Thanks, updated.
-- https://gitlab.winehq.org/wine/wine/-/merge_requests/5958#note_75141
This merge request was approved by Matteo Bruni. -- https://gitlab.winehq.org/wine/wine/-/merge_requests/5958
participants (3)
-
Fabian Maurer -
Fabian Maurer (@DarkShadow44) -
Matteo Bruni (@Mystral)