[PATCH 4/5] amstream: Zero-initialize DirectDraw surface desc. (Valgrind)

Henri Verbeet hverbeet at gmail.com
Wed Jul 29 06:33:29 CDT 2015


On 28 July 2015 at 23:14, Matteo Bruni <mbruni at codeweavers.com> wrote:
> diff --git a/dlls/amstream/mediastream.c b/dlls/amstream/mediastream.c
> index 947be1e..3725c68 100644
> --- a/dlls/amstream/mediastream.c
> +++ b/dlls/amstream/mediastream.c
> @@ -991,6 +991,7 @@ static HRESULT ddrawstreamsample_create(IDirectDrawMediaStream *parent, IDirectD
>              return hr;
>          }
>
> +        memset(&desc, 0, sizeof(desc));
>          desc.dwSize = sizeof(desc);
>          desc.dwFlags = DDSD_CAPS|DDSD_HEIGHT|DDSD_WIDTH|DDSD_PIXELFORMAT;
>          desc.dwHeight = 100;
This should not be needed. If this is for bug 38911, that's a
duplicate of bug 36383, and sort of a false positive.
ddraw_surface_create() clears DDSD_LPSURFACE if desc->lpSurface is
NULL. The issue is that desc->lpSurface may be uninitialized if
DDSD_LPSURFACE is not set, but in that case clearing the flag also
wouldn't make a difference. If we want to do something about the false
positive that should happen in ddraw_surface_create(). I don't
personally feel strongly about it one way or the other.



More information about the wine-devel mailing list