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/gif: Decode returns an image with empty palette #11150

Closed
dvyukov opened this issue Jun 10, 2015 · 1 comment
Closed

image/gif: Decode returns an image with empty palette #11150

dvyukov opened this issue Jun 10, 2015 · 1 comment
Milestone

Comments

@dvyukov
Copy link
Member

dvyukov commented Jun 10, 2015

The following program crashes with the panic:

package main

import (
    "bytes"
    "image/gif"
)

func main() {
    data := []byte("GIF89a000\x00000,00\x00\x00\x00\x000\x000\x02\b\r0000000\x00;")
    img, err := gif.Decode(bytes.NewReader(data))
    if err != nil {
        panic(err)
    }
    var w bytes.Buffer
    err = gif.Encode(&w, img, nil)
    if err != nil {
        panic(err)
    }
    _, err = gif.Decode(&w)
    if err != nil {
        panic(err)
    }
}
panic: gif: cannot encode image block with empty palette

goroutine 1 [running]:
main.main()
    gif.go:17 +0x219

Decode should not return an image with empty palette, it should return an error instead.

go version devel +b0532a9 Mon Jun 8 05:13:15 2015 +0000 linux/amd64

@ianlancetaylor ianlancetaylor added this to the Go1.6 milestone Jun 10, 2015
@gopherbot
Copy link

CL https://golang.org/cl/11064 mentions this issue.

@mikioh mikioh modified the milestones: Go1.5, Go1.6 Jun 18, 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
Development

No branches or pull requests

5 participants