all repos — captcha @ e6fb73402841aa4835165d9402634587e948de8e

Go package captcha implements generation and verification of image and audio CAPTCHAs.

audio: error handling; pad byte is 0, not 128.
Dmitry Chestnykh dmitry@codingrobots.com
Sun, 01 May 2011 12:48:01 +0200
commit

e6fb73402841aa4835165d9402634587e948de8e

parent

ad3bc714999c41d5d354dc1fc7087ac2a484859a

1 files changed, 4 insertions(+), 1 deletions(-)

jump to
M audio.goaudio.go

@@ -101,10 +101,13 @@ nn += 4

// Chunk data. n, err = a.body.WriteTo(w) n += int64(nn) + if err != nil { + return + } // Pad byte if chunk length is odd. // (As header has even length, we can check if n is odd, not chunk). if n % 2 != 0 { - w.Write([]byte{128}) + w.Write([]byte{0}) n++ } return