mirror of
https://github.com/golang/go
synced 2024-11-21 17:24:42 -07:00
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
This commit is contained in:
parent
4881e7744a
commit
05348ab0c8
@ -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 {
|
||||
|
Loading…
Reference in New Issue
Block a user