Skip to content
This repository has been archived by the owner on Sep 11, 2022. It is now read-only.

"index out of range" panic from resizeRGBA64 #27

Closed
teepark opened this issue Mar 12, 2015 · 2 comments
Closed

"index out of range" panic from resizeRGBA64 #27

teepark opened this issue Mar 12, 2015 · 2 comments

Comments

@teepark
Copy link

teepark commented Mar 12, 2015

In a goroutine spawned by the library no less, so it can't be recovered without patching it.

Here is the stack trace from the relevant goroutines:

panic: runtime error: index out of range

goroutine 34 [running]:
vendor/resize.resizeRGBA64(0xc20815e480, 0xc20815e140, 0x0, 0xc2080e7500, 0xc3c, 0xc3c, 0xc2080ef900, 0x30f, 0x30f, 0x4)
        /var/lib/gopath/src/git.pixinote.net/postman/vendor/resize/converter.go:152 +0x6b7
vendor/resize.func012()
        /var/lib/gopath/src/git.pixinote.net/postman/vendor/resize/resize.go:276 +0xce
created by vendor/resize.Resize
        /var/lib/gopath/src/git.pixinote.net/postman/vendor/resize/resize.go:277 +0x2a59

goroutine 31 [runnable]:
sync.(*WaitGroup).Wait(0xc2080d5c00)
        /usr/local/go/src/sync/waitgroup.go:132 +0x169
vendor/resize.Resize(0x30f, 0x30f, 0x7fcc97bda3d8, 0xc20815e440, 0x2, 0x0, 0x0)
        /var/lib/gopath/src/git.pixinote.net/postman/vendor/resize/resize.go:279 +0x2a98
endpoint.handleResize(0x8b25f0, 0x4, 0x15)
        /var/lib/gopath/src/git.pixinote.net/postman/endpoint/render.go:74 +0xa06
created by endpoint.putNoteImage
        /var/lib/gopath/src/git.pixinote.net/postman/endpoint/notes.go:668 +0x9fc
@nfnt
Copy link
Owner

nfnt commented Mar 18, 2015

I'm sorry, but without a sample program that can reproduce your issue, there is very little that I can do for you at the moment.

@teepark
Copy link
Author

teepark commented Apr 24, 2015

finally reproduced it consistently enough to debug, and I found that I was starting from an image with 0 height and 0 width, and trying to resize it up from there.

I was performing a crop with github.com/oliamb/cutter first, but a problem deserializing the crop dimensions caused me to chop it down to 0x0.

It might be worth it to check for this specific scenario, but the problem was certainly on my side.

@teepark teepark closed this as completed Apr 24, 2015
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants