]> Cypherpunks repositories - gostls13.git/commitdiff
image/png: fix error message to not return width twice
authorBrad Fitzpatrick <bradfitz@golang.org>
Mon, 6 May 2013 16:59:33 +0000 (09:59 -0700)
committerBrad Fitzpatrick <bradfitz@golang.org>
Mon, 6 May 2013 16:59:33 +0000 (09:59 -0700)
Fixes #5413

R=golang-dev, dave, adg
CC=golang-dev
https://golang.org/cl/9153045

src/pkg/image/png/writer.go

index 093d47193ba50d351733bab1118c14d7c0934c31..629452cbfa1b88a0c47331f1b6e057ee370c894b 100644 (file)
@@ -436,7 +436,7 @@ func Encode(w io.Writer, m image.Image) error {
        // also rejected.
        mw, mh := int64(m.Bounds().Dx()), int64(m.Bounds().Dy())
        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