From: Connor McAdams cmcadams@codeweavers.com
Signed-off-by: Connor McAdams cmcadams@codeweavers.com --- dlls/d3dx10_43/tests/d3dx10.c | 6 ++---- dlls/d3dx9_36/d3dx_helpers.c | 4 +++- 2 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/dlls/d3dx10_43/tests/d3dx10.c b/dlls/d3dx10_43/tests/d3dx10.c index 3a5e6efd6e5..e6989f76916 100644 --- a/dlls/d3dx10_43/tests/d3dx10.c +++ b/dlls/d3dx10_43/tests/d3dx10.c @@ -3008,7 +3008,6 @@ static void test_legacy_dds_header_image_info(void) { (DDS_CAPS | DDS_WIDTH | DDS_HEIGHT | DDS_PIXELFORMAT), 4, 4, 1, (4 * 4), 3, 0, 0, { S_OK, 4, 4, 1, 1, 3, 0, DXGI_FORMAT_R8G8B8A8_UNORM, D3D10_RESOURCE_DIMENSION_TEXTURE2D, }, 0, - .todo_hr = TRUE }, /* Depth value set to 4, but no caps bits are set. Depth is ignored. */ { @@ -3108,7 +3107,7 @@ static void test_legacy_dds_header_image_info(void) ok(hr == E_FAIL, "Unexpected hr %#lx.\n", hr);
hr = D3DX10GetImageInfoFromMemory(&dds, sizeof(dds), NULL, &info, NULL); - todo_wine ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); }
static void test_dxt10_dds_header_image_info(void) @@ -3147,7 +3146,6 @@ static void test_dxt10_dds_header_image_info(void) 0, 4, 4, 0, (4 * 4), 1, 0, 0, { DXGI_FORMAT_R8G8B8A8_UNORM, D3D10_RESOURCE_DIMENSION_TEXTURE2D, 0, 1, 0, }, { S_OK, 4, 4, 1, 1, 1, 0, DXGI_FORMAT_R8G8B8A8_UNORM, D3D10_RESOURCE_DIMENSION_TEXTURE2D, }, 0, - .todo_hr = TRUE }, /* * Setting the misc_flags2 field to anything other than 0 results in @@ -3275,7 +3273,7 @@ static void test_dxt10_dds_header_image_info(void) ok(hr == E_FAIL, "Unexpected hr %#lx.\n", hr);
hr = D3DX10GetImageInfoFromMemory(&dds, sizeof(dds), NULL, &info, NULL); - todo_wine ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); }
static void test_get_image_info(void) diff --git a/dlls/d3dx9_36/d3dx_helpers.c b/dlls/d3dx9_36/d3dx_helpers.c index 3574bc8324f..535461db599 100644 --- a/dlls/d3dx9_36/d3dx_helpers.c +++ b/dlls/d3dx9_36/d3dx_helpers.c @@ -1149,7 +1149,9 @@ static HRESULT d3dx_initialize_image_from_dds(const void *src_data, uint32_t src if (src_data_size < expected_src_data_size) { WARN("File is too short %u, expected at least %u bytes.\n", src_data_size, expected_src_data_size); - return D3DXERR_INVALIDDATA; + /* D3DX10/D3DX11 do not validate the size of the pixels, only the header. */ + if (!(flags & D3DX_IMAGE_SUPPORT_DXT10)) + return D3DXERR_INVALIDDATA; }
image->palette = (is_indexed_fmt) ? (PALETTEENTRY *)(((uint8_t *)src_data) + sizeof(*header)) : NULL;