d3dx9: Add a WARN to get_image_info_from_dds about too short DDS files.

This commit is contained in:
Józef Kucia 2012-05-22 22:35:57 +02:00 committed by Alexandre Julliard
parent d313e4f9d3
commit 3a94473802
1 changed files with 3 additions and 0 deletions

View File

@ -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;