[PATCH v2 0/1] MR6894: d3dx9: Remove superfluous null check (Coverity)
-- v2: d3dx9: Remove superfluous null check (Coverity) https://gitlab.winehq.org/wine/wine/-/merge_requests/6894
From: Fabian Maurer <dark.shadow4(a)web.de> --- dlls/d3dx9_36/surface.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dlls/d3dx9_36/surface.c b/dlls/d3dx9_36/surface.c index 61b0283796d..9d2dc96a979 100644 --- a/dlls/d3dx9_36/surface.c +++ b/dlls/d3dx9_36/surface.c @@ -497,7 +497,7 @@ static HRESULT d3dx_save_pixels_to_memory(struct d3dx_pixels *src_pixels, const const struct pixel_format_desc *dst_fmt_desc; uint32_t dst_row_pitch, dst_slice_pitch; struct d3dx_pixels dst_pixels; - ID3DXBuffer *buffer = NULL; + ID3DXBuffer *buffer; uint8_t *pixels; HRESULT hr; @@ -554,7 +554,7 @@ static HRESULT d3dx_save_pixels_to_memory(struct d3dx_pixels *src_pixels, const *dst_buffer = buffer; exit: - if (buffer && *dst_buffer != buffer) + if (*dst_buffer != buffer) ID3DXBuffer_Release(buffer); return hr; } -- GitLab https://gitlab.winehq.org/wine/wine/-/merge_requests/6894
On Thu Nov 28 16:55:17 2024 +0000, Matteo Bruni wrote:
The check is definitely unnecessary right now. I'd expect that to change when support for more file formats is introduced, but I guess there is an argument for getting rid of the Coverity warning in the meantime, especially considering that code freeze is coming soon. Can you also get rid of the `buffer` initialization at the top of the function while at it? It should be unnecessary as well. Thanks, updated
-- https://gitlab.winehq.org/wine/wine/-/merge_requests/6894#note_89137
This merge request was approved by Matteo Bruni. -- https://gitlab.winehq.org/wine/wine/-/merge_requests/6894
participants (3)
-
Fabian Maurer -
Fabian Maurer (@DarkShadow44) -
Matteo Bruni (@Mystral)