signalmeow/attachments: fix splitting stream with chunks over 8192 bytes

This commit is contained in:
Tulir Asokan 2025-01-22 19:05:17 +02:00
parent 0b4d63a62b
commit 15485eb0fd

View file

@ -151,7 +151,7 @@ func splitChunksStream(input io.Reader, callback func([]byte) error) error {
continue
}
if msgLen > uint64(len(cachedBuf)) {
cachedBuf = make([]byte, min(msgLen, 8192))
cachedBuf = make([]byte, max(msgLen, 8192))
}
buf := cachedBuf[:msgLen]
_, err = io.ReadFull(input, buf)