Fix crash when all durations are zero #114
Open
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Hi,
I am developing an Android application for multiple SNS like bluesky, mastodon and misskey.
We have been using this library as an APNG decoder for a social networking service called Misskey, but there was a problem with crashes when loading an incorrect file with a total duration of 0.
This fix prevents crashes as a minimum fix.
It is desirable to be able to set some kind of duration and display all frames as animated, but I could not figure out how to do that, so the first frame is displayed as a fixed frame.
Thanks.
sample:
![midopen_duration_zero](https://private-user-images.githubusercontent.com/73930/339968829-5bde09ad-c65b-44dc-99cd-421a9a487f1a.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjAyODIxNTQsIm5iZiI6MTcyMDI4MTg1NCwicGF0aCI6Ii83MzkzMC8zMzk5Njg4MjktNWJkZTA5YWQtYzY1Yi00NGRjLTk5Y2QtNDIxYTlhNDg3ZjFhLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA3MDYlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwNzA2VDE2MDQxNFomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTMxOGY3NzMwYzA0MDI2Njg0NWVlZTI3MGYxODgxYzBhNjYwN2Y4NjhjMDkyMDEyYjVlNWQ0OTg2YzkwMzhlY2ImWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.9b5EJsBHmnySv3L9SboZLsY-kGb7FI1FLiXmW1wyhbQ)