diff --git a/cryptpng.go b/cryptpng.go index ac21bdb..1722f9a 100644 --- a/cryptpng.go +++ b/cryptpng.go @@ -114,13 +114,13 @@ func createChunk(data []byte, name string) ChunkData { rawLength := make([]byte, 4) binary.BigEndian.PutUint32(rawLength, uint32(len(data))) rawName := []byte(name) - dataAndName := make([]byte, 0) // len(rawName) + len(data) + dataAndName := make([]byte, 0) dataAndName = append(dataAndName, rawName...) dataAndName = append(dataAndName, data...) crc := crc32.ChecksumIEEE(dataAndName) rawCrc := make([]byte, 4) binary.BigEndian.PutUint32(rawCrc, crc) - fullData := make([]byte, 0) // len(rawLength) + len(dataAndName) + 4 + fullData := make([]byte, 0) fullData = append(fullData, rawLength...) fullData = append(fullData, dataAndName...) fullData = append(fullData, rawCrc...)