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

zlib.NewReader(bytes.NewBuffer(stream)) can return an error and a nil value #41

Open
volker-schukai opened this issue Apr 26, 2021 · 1 comment

Comments

@volker-schukai
Copy link

I have a pdf where the encoding does not seem to be supported, but
I think you should check the error here, otherwise I get a runtime error.

runtime error: invalid memory address or nil pointer dereference

zlibReader, _ := zlib.NewReader(bytes.NewBuffer(compressedObj.Stream.Bytes))

@johan-lejdung
Copy link
Contributor

I'm running into the same issue, it's assuming zlib can de-compress it and is returning

// ErrHeader is returned when reading ZLIB data that has an invalid header.
ErrHeader = errors.New("zlib: invalid header")

I fixed it in my fork chaintraced#1, but haven't opened a PR here yet since my previous one is still dangling. #60

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

No branches or pull requests

2 participants