-
-
Notifications
You must be signed in to change notification settings - Fork 450
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
Panic on image extract #871
Comments
I think this is the same bug as: #804 sorry for the additional issue. |
Perfect! |
Sent via email. I hope that's ok. |
The file seems to be corrupt:
Neither does it open with Adobe Reader or Mac Preview. |
Thanks for taking a look. Even though the file is corrupt and only somewhat readable I feel like it shouldn't panic. Especially from using an index out of bounds type error (length should be checked and image skipped?) I could wrap a recover around image extract but would prefer if it didn't panic. |
My point was that the attached file got damaged probably during or on the way to the upload. ...unless you can also not open this file with Adobe Reader - then it would be corrupt for sure and needs fixing anyways. |
This is fixed with the latest commit! |
Thank you!! |
I'm getting
panic: runtime error: index out of range [45675] with length 45675
on
pdfcpu/pdfcpu/pkg/pdfcpu/writeImage.go:346
. when trying to extract images from PDF.Is this potentially an off by one error? Maybe it just needs an length check and if it is out of bounds to use the defaulted
alpha := uint8(255)
?Linux Arch
6.8.8-arch1-1 #1 SMP PREEMPT_DYNAMIC Sun, 28 Apr 2024 15:59:47 +0000 x86_64 GNU/Linux
Commenting out
alpha = im.softMask[y*im.w+x]
makes my PDF extract images without panicThe text was updated successfully, but these errors were encountered: