Skip to content

Unify panic handling for all encoders#2991

Open
RunDevelopment wants to merge 1 commit into
image-rs:mainfrom
RunDevelopment:encoder-unified-panic-handling
Open

Unify panic handling for all encoders#2991
RunDevelopment wants to merge 1 commit into
image-rs:mainfrom
RunDevelopment:encoder-unified-panic-handling

Conversation

@RunDevelopment
Copy link
Copy Markdown
Member

Changes:

  • Add assert_buf_len util method to ExtendedColorType to help with checking.
  • Use the same check in all encoders and trace callers consistently.

I noticed that some encoders didn't panic when the trait docs said they should. So I made sure all encoders do a buffer length check.

Maybe the util method should be in crate::util? I put it on ExtendedColorType purely because it was easy for now.

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.

1 participant