fixes D3D E_OUTOFMEMORY and guards against a binary MDL crash case