Skip to content

Revert 0xFF marker check #147

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

Merged
merged 2 commits into from
Apr 27, 2020
Merged

Revert 0xFF marker check #147

merged 2 commits into from
Apr 27, 2020

Conversation

ggopcceop
Copy link
Contributor

I has some webcam from different venders that i use v4l2 to capture mjpg images to do some processing. When i used image-rs to decode some of the images, i got Error: IoError(Custom { kind: UnexpectedEof, error: "failed to fill whole buffer" }).

After some investigation i found that the

fn read_marker(&mut self) -> Result<Marker> {

function skipped EOI marker when there is multiple 0xff before 0xD9.

And there is pull request from #100 that removed code to skip optional 0xff. So I added it back.

There is also a test image i took that have this error before. but I'm not sure where to put this image in the tests dir, since the crash test doest care decode result.

Copy link
Member

@197g 197g left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me. I was confused with the wording for a moment, it doesn't directly revert the previous change here but amends which fixes further cases. Is the test image your own, or is there other copyright attached?

@197g 197g mentioned this pull request Apr 27, 2020
@ggopcceop
Copy link
Contributor Author

Sorry about the confusion. And yes, I took that image my self, you have my consent to use the image freely.

@197g 197g merged commit 7ca9b90 into image-rs:master Apr 27, 2020
wartmanm pushed a commit to wartmanm/jpeg-decoder that referenced this pull request Oct 4, 2021
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.

None yet

2 participants