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

If less than 2 bytes left, there will not be another SOT or an EOC #1572

Closed
wants to merge 1 commit into from

Conversation

radarhere
Copy link
Contributor

No description provided.

@rouault
Copy link
Collaborator

rouault commented Dec 26, 2024

@radarhere Can you attach a JPEG2000 file demonstrating the need for this change ?

@radarhere
Copy link
Contributor Author

Oh, I didn't mean to imply there was a need. I just considered opj_j2k_read_sod in isolation, and thought that if there were less than 2 bytes left, then

J2K_STATE_TPHSOT = 0x0008, /**< the decoding process is in a tile part header and expects a SOT marker */

wasn't the case, and
J2K_STATE_NEOC = 0x0040, /**< the decoding process must not expect a EOC marker because the codestream is truncated */

reflected reality better.

If you wish to decline this for the sake of performance or for the sake of code simplicity, that is fine.

@rouault
Copy link
Collaborator

rouault commented Dec 26, 2024

IMHO this code base is sufficiently tricky to avoid adding new code without a clear evidence it is needed

@radarhere
Copy link
Contributor Author

Ok, sure. Thanks for the review.

@radarhere radarhere closed this Dec 27, 2024
@radarhere radarhere deleted the neoc branch December 27, 2024 00:34
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 this pull request may close these issues.

2 participants