[2/3] d3dx9: Add a WARN to get_image_info_from_dds about too short DDS files.

Józef Kucia joseph.kucia at gmail.com
Tue May 22 15:35:57 CDT 2012


---
 dlls/d3dx9_36/surface.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/dlls/d3dx9_36/surface.c b/dlls/d3dx9_36/surface.c
index 6b0786c..821d51e 100644
--- a/dlls/d3dx9_36/surface.c
+++ b/dlls/d3dx9_36/surface.c
@@ -372,7 +372,10 @@ static HRESULT get_image_info_from_dds(const void *buffer, UINT length, D3DXIMAG
    expected_length *= faces;
    expected_length += sizeof(*header);
    if (length < expected_length)
+   {
+       WARN("File is too short %u, expected at least %u bytes\n", length, expected_length);
        return D3DXERR_INVALIDDATA;
+   }
 
    info->ImageFileFormat = D3DXIFF_DDS;
 
-- 
1.7.8.6




More information about the wine-patches mailing list