[Bug 36654] valgrind shows invalid read/write in d3d8/tests/device.c