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

image/png: interface conversion: color.Color is color.NRGBA, not color.RGBA #10423

Closed
dvyukov opened this issue Apr 11, 2015 · 0 comments
Closed

image/png: interface conversion: color.Color is color.NRGBA, not color.RGBA #10423

dvyukov opened this issue Apr 11, 2015 · 0 comments
Assignees
Milestone

Comments

@dvyukov
Copy link
Member

@dvyukov dvyukov commented Apr 11, 2015

Run the following program on the following input:

package main

import (
    "bytes"
    "image/png"
    "io/ioutil"
    "os"
)

func main() {
    data, _ := ioutil.ReadFile(os.Args[1])
    png.Decode(bytes.NewReader(data))
}

https://drive.google.com/file/d/0B20Uwp8Hs1oCMFhqU0I1eUNIaWM/view?usp=sharing

It crashes as:

panic: interface conversion: color.Color is color.NRGBA, not color.RGBA

goroutine 1 [running]:
runtime.gopanic(0x5176e0, 0xc208010300)
    /ssd/src/go10/src/runtime/panic.go:477 +0x3fe fp=0xc20803dc80 sp=0xc20803dc00
runtime.assertI2T(0x5260c0, 0x7f01b18fe378, 0xc20800f580, 0xc20803dcfc)
    /ssd/src/go10/src/runtime/iface.go:187 +0x1c0 fp=0xc20803dcb0 sp=0xc20803dc80
image/png.(*decoder).parsetRNS(0xc20800d500, 0xad, 0x0, 0x0)
    /ssd/src/go10/src/image/png/reader.go:268 +0x4d8 fp=0xc20803dd88 sp=0xc20803dcb0
image/png.(*decoder).parseChunk(0xc20800d500, 0x0, 0x0)
    /ssd/src/go10/src/image/png/reader.go:690 +0x9e7 fp=0xc20803de68 sp=0xc20803dd88
image/png.Decode(0x7f01b18fe2d8, 0xc208012420, 0x0, 0x0, 0x0, 0x0)
    /ssd/src/go10/src/image/png/reader.go:752 +0x247 fp=0xc20803df08 sp=0xc20803de68
main.main()
    /tmp/png.go:12 +0x10b fp=0xc20803df90 sp=0xc20803df08

I am on commit a5dec38

@dvyukov dvyukov added the repo-main label Apr 11, 2015
@dvyukov dvyukov added this to the Go1.5 milestone Apr 11, 2015
@rsc rsc removed the repo-main label Apr 14, 2015
@nigeltao nigeltao closed this in 7e7d55f Apr 15, 2015
@golang golang locked and limited conversation to collaborators Jun 25, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
4 participants
You can’t perform that action at this time.