oov / psd

PSD/PSB(Photoshop) file reader for Go programming language

Home Page:https://godoc.org/github.com/oov/psd

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Panic: slice bounds out of range

bcvery1 opened this issue · comments

commented

I'm getting a panic when decoding a specific PSD file. I'm unable to provide the file because it belongs to a client, but if I'm able to reproduce this with a test PSD, I'll upload that as an example.

panic: runtime error: slice bounds out of range [17:10]

goroutine 650 [running]:
github.com/oov/psd.decodePackBitsPerLine(0xc0052d0200, 0x7ad00, 0x4cc200, 0xc0011790bf, 0x7de, 0x1723fe, 0xc00069b1e0, 0x106, 0xa3c)
	/home/ben/go/pkg/mod/github.com/oov/psd@v0.0.0-20191130205417-6816fb1e0e22/compress_other.go:82 +0x29e
github.com/oov/psd.decodePackBits.func1(0xc0005bd510, 0xc0052d0200, 0x7ad00, 0x4cc200, 0xc00112e68b, 0x4b212, 0x1bce32, 0xc00069b1e0, 0x106, 0xa3c)
	/home/ben/go/pkg/mod/github.com/oov/psd@v0.0.0-20191130205417-6816fb1e0e22/compress_other.go:63 +0xdf
created by github.com/oov/psd.decodePackBits
	/home/ben/go/pkg/mod/github.com/oov/psd@v0.0.0-20191130205417-6816fb1e0e22/compress_other.go:61 +0x435

Edit:
When running ffprobe filename.psd get this message:

[psd @ 0x562fcc146ec0] Invalid rle char.

Which does not appear on other similar PSDs which are not causing panics

Please try latest.

commented

The latest resolves the panic, many thanks.