[Bug 38685] valgrind shows an invalid read in d3d9/tests/d3d9ex.c