fix: Adjust filestream length when writing chunks

This commit is contained in:
Teacup
2025-08-08 17:08:19 -07:00
committed by Natsumi
parent 42fadd7e65
commit 0fb3f2fbb7

View File

@@ -100,6 +100,7 @@ public class PNGFile : IDisposable
// Write new chunk, append rest of file
var chunkBytes = chunk.GetBytes();
fileStream.SetLength(fileStream.Length + CHUNK_NONDATA_SIZE + chunk.Length);
fileStream.Write(chunkBytes, 0, chunkBytes.Length);
fileStream.Write(fileBytes, 0, fileBytes.Length);