Skip to content

mercury SOT walk rejects issue775.j2k over a short final Psot #436

Description

@boxerab

nonregression/issue775.j2k (and issue775-2.j2k, same bytes) has a last tile-part whose Psot ends 4 bytes short of the file end. mercury's SOT walk in plan.rs (draft, the sequential branch) only stops when fewer than 2 bytes remain, so it tries to read a 12-byte SOT at that position and the plan fails with "io: failed to fill whole buffer". the stream falls back to classic, which also fails it ("No tiles were decompressed", the tile COD carries an HT block style), so today nothing is lost.

ending the walk when fewer than 12 bytes remain (or when the bytes there are not an SOT) would let mercury finish the chain and take the stream once HT lands. it also makes the walk tolerate trailing garbage it currently refuses, so the change needs a run over the fuzzer corpus (tests/nonregression clusterfuzz inputs and the mercury fuzzer) before landing, to confirm no stream that used to fall back now mis-decodes.

Activity

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