Ver Fonte

Fix writing of block size

Alexander Neganov há 11 anos atrás
pai
commit
9b7b588240
1 ficheiros alterados com 2 adições e 2 exclusões
  1. 2 2
      writer.go

+ 2 - 2
writer.go

@@ -245,9 +245,9 @@ func (z *Writer) compressBlock(zb *block) {
 
 // writeBlock writes a frame block to the underlying io.Writer (size, data).
 func (z *Writer) writeBlock(zb *block) (int, error) {
-	bLen := int32(len(zb.zdata))
+	bLen := uint32(len(zb.zdata))
 	if !zb.compressed {
-		bLen = -bLen
+		bLen |= 1 << 31
 	}
 
 	n := 0