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

Debug assert zero-sized frames #174

Merged
merged 1 commit into from
Jan 13, 2024
Merged

Conversation

kornelski
Copy link
Contributor

There are probably real-world broken GIF files with 0-sized frames, and this could affect users transcoding such files, so I don't want to make it a hard error. But it may be a debug assert, catching programming errors, and making handling of it the application's problem.

Fixes #135

@fintelia
Copy link
Contributor

If a user complains that they're hitting a panic when transcoding zero-sized frames, "compile in release mode" feels like the wrong advice to give. Perhaps instead assert in all modes, but add a allow_zero_size_frames (or similar) method that disables the assert?

@kornelski
Copy link
Contributor Author

My suggestion would be "filter out 0-sized frames before passing them to the encoder". They don't serve any purpose, so I think it should be on the callers to weed them out.

@kornelski kornelski merged commit 422edba into image-rs:master Jan 13, 2024
13 checks passed
@kornelski kornelski deleted the frame-size branch January 13, 2024 01:47
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