Skip to content

Insufficient validity check for transcodable leads to assert #557

@MarkCallow

Description

@MarkCallow

Discussed in #555

There is a transcodable check at the top of ktxTexture2_TranscodeBasis

    if (colorModel != KHR_DF_MODEL_UASTC
        && This->supercompressionScheme != KTX_SS_BASIS_LZ)
    return KTX_INVALID_OPERATION; // Not in a transcodable format.

which does not check if the colorModel is correct for BASIS_LZ. Further down is an assert checking for MODEL_UASTC when model is not MODEL_ETC1S. A bad input file than therefore cause the debug version of the library to crash.

This will be fixed by validating the color model for BASIS_LZ during during file loading. The assert will also be removed as it doesn't do anything useful.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions