Skip to content

image/draw: Panic when writing GIF file #9177

@ernestoalejo

Description

@ernestoalejo
What does 'go version' print?
I'm checking with the bleeding edge code.


What steps reproduce the problem?

1. go get github.com/nfnt/resize
2. go get github.com/oliamb/cutter
3. go run foo.go


What happened?
panic: runtime error: invalid memory address or nil pointer dereference

image/draw.clip(...)
    /go/src/pkg/image/draw/draw.go:86 +0x43e
image/draw.floydSteinberg.Draw(...)
    /go/src/pkg/image/draw/draw.go:62 +0x87
image/draw.floydSteinberg.Draw·i(...)
    <autogenerated>:7 +0x89
image/gif.Encode(...)
    /go/src/pkg/image/gif/writer.go:316 +0x521


What should have happened instead?
Write the GIF to the output file.

Please provide any additional information below.
https://code.google.com/p/go/source/browse/src/image/draw/draw.go#62 it's calling the
clip function with nil and then it tries to
https://code.google.com/p/go/source/browse/src/image/draw/draw.go#86 write to that nil

Attachments:

  1. sample.gif (431976 bytes)
  2. foo.go (783 bytes)

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions