-
Notifications
You must be signed in to change notification settings - Fork 456
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
Fix some division-by-zero problems in src\lib\openjp2\pi.c #845
Conversation
@mayeut The fix just solve the issues on the spot. I think there are two ways to solve them on the spot. If division-by-zero problems are detected, just The root cause needs further investigate. |
All
The second option is only to be considered if it can be done in the short term. |
I vote for option (2), it seems we are not doing sanity checks on inputs. See for example #731 (comment) |
Hi, I uploaded a minimized poc file at #731 (comment) |
After I did some investigation on this issue, I think it's hard to do sanity checks earlier. The following j2k image was taken from the JPEG2000 Standard Document (Part 1) (
We can create a proof-of-concept file just by modifying three bytes.
Now we can figure out why the division-by-zero problem will be happened. So I think that all the values are legal and it's hard to do sanity checks earlier. BTW, I'm not familiar with the whole standard. The above text is just my analysis. Please point out if something is wrong. Thanks. |
@detonin I do not believe so since kakadu is also failing later in the pipeline (as indicated here: #731 (comment)) |
I've fixed those issues in a somewhat equivalent way in d27ccf0 . Closing |
The following issues were fixed in this commit.
#731
#732
#777
#778
#779
#780