Am 15.01.2016 um 16:52 schrieb Henri Verbeet:
On 14 January 2016 at 22:39, Stefan Dösinger stefandoesinger@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.
Yes, valgrind doesn't understand the underlying logic. lpSurface is only valid if DDSD_LPSURFACE is set, but valgrind can't know this.