Commit 05348ab0 authored by Rob Pike's avatar Rob Pike

image/gif: fix buglet in graphics extension.

need to ReadFull, not Read, to get extension data.

R=nigeltao
CC=golang-dev
https://golang.org/cl/4576043
parent 4881e774
......@@ -274,7 +274,7 @@ func (d *decoder) readExtension() os.Error {
return fmt.Errorf("gif: unknown extension 0x%.2x", extension)
}
if size > 0 {
if _, err := d.r.Read(d.tmp[0:size]); err != nil {
if _, err := io.ReadFull(d.r, d.tmp[0:size]); err != nil {
return err
}
}
......@@ -406,8 +406,8 @@ func DecodeAll(r io.Reader) (*GIF, os.Error) {
return gif, nil
}
// DecodeConfig returns the color model and dimensions of a GIF image without
// decoding the entire image.
// DecodeConfig returns the global color model and dimensions of a GIF image
// without decoding the entire image.
func DecodeConfig(r io.Reader) (image.Config, os.Error) {
var d decoder
if err := d.decode(r, true); err != nil {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment