[Bug 36658] valgrind shows an invalid read in ddraw/tests/d3d.c