mirror of
https://github.com/doitsujin/dxvk.git
synced 2025-02-07 16:54:14 +01:00
[d3d11] Fix GetData parameter validation
We're supposed to return an error if a null pointer is passed along with a non-zero DataSize. Fixes more wine test failures.
This commit is contained in:
parent
43389d8ef4
commit
684355dfca
@ -60,22 +60,17 @@ namespace dxvk {
|
|||||||
void* pData,
|
void* pData,
|
||||||
UINT DataSize,
|
UINT DataSize,
|
||||||
UINT GetDataFlags) {
|
UINT GetDataFlags) {
|
||||||
if (!pAsync)
|
if (!pAsync || (DataSize && !pData))
|
||||||
return E_INVALIDARG;
|
return E_INVALIDARG;
|
||||||
|
|
||||||
// Make sure that we can safely write to the memory
|
// Check whether the data size is actually correct
|
||||||
// location pointed to by pData if it is specified.
|
if (DataSize && DataSize != pAsync->GetDataSize())
|
||||||
if (DataSize == 0)
|
|
||||||
pData = nullptr;
|
|
||||||
|
|
||||||
if (pData && pAsync->GetDataSize() != DataSize) {
|
|
||||||
Logger::err(str::format(
|
|
||||||
"D3D11: GetData: Data size mismatch",
|
|
||||||
"\n Expected: ", pAsync->GetDataSize(),
|
|
||||||
"\n Got: ", DataSize));
|
|
||||||
return E_INVALIDARG;
|
return E_INVALIDARG;
|
||||||
}
|
|
||||||
|
|
||||||
|
// Passing a non-null pData is actually allowed if
|
||||||
|
// DataSize is 0, but we should ignore that pointer
|
||||||
|
pData = DataSize ? pData : nullptr;
|
||||||
|
|
||||||
// Ensure that all query commands actually get
|
// Ensure that all query commands actually get
|
||||||
// executed before trying to access the query
|
// executed before trying to access the query
|
||||||
SynchronizeCsThread();
|
SynchronizeCsThread();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user