Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Legacy DDS files with a DDS_HEADER size of 24 #399

Closed
0xC0000054 opened this issue Oct 3, 2023 · 0 comments · Fixed by #400
Closed

Legacy DDS files with a DDS_HEADER size of 24 #399

0xC0000054 opened this issue Oct 3, 2023 · 0 comments · Fixed by #400

Comments

@0xC0000054
Copy link
Contributor

0xC0000054 commented Oct 3, 2023

Related to 0xC0000054/pdn-ddsfiletype-plus#16

The OP says the files are from S.T.A.L.K.E.R.: Shadow of Chernobyl, a DX 9-based game.
I have no idea why these files use 24 for the DDS_HEADER size, did they forget the 1 when typing 124.

A sample for your test suite: dds_header size 24.zip

I plan to submit a PR with the following fix. and an updated check in the DX 10 code path:

if (flags & DDS_FLAGS_PERMISSIVE)
{
    if (pHeader->size != 24 /* Known variant */
        && pHeader->size != sizeof(DDS_HEADER))
    {
        return HRESULT_E_NOT_SUPPORTED;
    }
}
else if (pHeader->size != sizeof(DDS_HEADER))
{
    return HRESULT_E_NOT_SUPPORTED;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant