[PATCH] ddraw: Fix use of uninitialized memory.

Henri Verbeet hverbeet at gmail.com
Fri Jan 15 09:52:12 CST 2016


On 14 January 2016 at 22:39, Stefan Dösinger <stefandoesinger at gmail.com> wrote:
> Am 2016-01-14 um 20:49 schrieb Thomas Faller:
>> +    if ((desc->dwFlags & DDSD_LPSURFACE)
>> +            && ((desc->ddsCaps.dwCaps & DDSCAPS_ALLOCONLOAD) || !desc->lpSurface))
>>          desc->dwFlags &= ~DDSD_LPSURFACE;
> I'd say report this to valgrind as well. If DDSD_LPSURFACE isn't set in
> the first place then randomly unsetting it doesn't really hurt.
Yeah, this is really more about making Valgrind shut-up than fixing
anything. I don't think Valgrind has enough information to be able to
tell it's actually ok though.

The bigger issue is that it looks like the code is just wrong though.
It's one of those things that has zero tests (because, ddraw), so I
tried adding some, and DDSD_LPSURFACE with a NULL lpSurface pretty
much returns DDERR_INVALIDPARAMS regardless of DDSCAPS_ALLOCONLOAD or
not.



More information about the wine-devel mailing list