mirror of
https://github.com/golang/go
synced 2024-11-18 01:14:48 -07:00
image/png: fix error message to not return width twice
Fixes #5413 R=golang-dev, dave, adg CC=golang-dev https://golang.org/cl/9153045
This commit is contained in:
parent
a21b36da1c
commit
1294f14f1f
@ -436,7 +436,7 @@ func Encode(w io.Writer, m image.Image) error {
|
|||||||
// also rejected.
|
// also rejected.
|
||||||
mw, mh := int64(m.Bounds().Dx()), int64(m.Bounds().Dy())
|
mw, mh := int64(m.Bounds().Dx()), int64(m.Bounds().Dy())
|
||||||
if mw <= 0 || mh <= 0 || mw >= 1<<32 || mh >= 1<<32 {
|
if mw <= 0 || mh <= 0 || mw >= 1<<32 || mh >= 1<<32 {
|
||||||
return FormatError("invalid image size: " + strconv.FormatInt(mw, 10) + "x" + strconv.FormatInt(mw, 10))
|
return FormatError("invalid image size: " + strconv.FormatInt(mw, 10) + "x" + strconv.FormatInt(mh, 10))
|
||||||
}
|
}
|
||||||
|
|
||||||
var e encoder
|
var e encoder
|
||||||
|
Loading…
Reference in New Issue
Block a user