Skip to content

ios_ktx2png: tiled check accepts block counts it has not seen #2890

Done

Description

@abrignoni

KTX_reader.untile_astc_4x4 (from #2887) treats any texture with at least the padded block count as tiled. Two shapes it would get wrong, neither seen in the files below:

  • A tile-aligned texture in linear order, with HEAD word 12 = 0 and extra trailing blocks, would be reordered and come out scrambled.
  • The block count is floor divided, so a payload up to 15 bytes longer than a valid length still passes the count check.

Every SplashBoard and Widget .ktx in six corpus images (iOS 18 and 26, 2,632 files) is one of two shapes: exactly one block per 4x4 pixels with word 12 = 0, or the padded surface plus one block with word 12 = 1. None is tile-aligned.

Possible fix: treat a texture as tiled only at exactly padded + 1 blocks, or at exactly padded blocks with word 12 = 1; as linear only at exactly one block per 4x4 pixels; and leave anything else alone.

Activity

  1. added a commit that references this issue on Nov 25, 2026
    12c7bde
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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