audio: error handling; pad byte is 0, not 128.
Dmitry Chestnykh dmitry@codingrobots.com
Sun, 01 May 2011 12:48:01 +0200
1 files changed,
4 insertions(+),
1 deletions(-)
jump to
M
audio.go
→
audio.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