diff --git a/AssetRipper.TextureDecoder/Exr/ExrChannelList.cs b/AssetRipper.TextureDecoder/Exr/ExrChannelList.cs index c23487c..8f042ed 100644 --- a/AssetRipper.TextureDecoder/Exr/ExrChannelList.cs +++ b/AssetRipper.TextureDecoder/Exr/ExrChannelList.cs @@ -4,7 +4,7 @@ public readonly record struct ExrChannelList(ExrChannel[] Channels) : IExrDataTy { public static ReadOnlySpan TypeName => "chlist"u8; - public int Size => Channels.Sum(c => c.Size); + public int Size => Channels.Sum(c => c.Size) + sizeof(byte); public void Write(BinaryWriter writer) { diff --git a/AssetRipper.TextureDecoder/Exr/ExrWriter.cs b/AssetRipper.TextureDecoder/Exr/ExrWriter.cs index 5f73e78..056325b 100644 --- a/AssetRipper.TextureDecoder/Exr/ExrWriter.cs +++ b/AssetRipper.TextureDecoder/Exr/ExrWriter.cs @@ -75,7 +75,7 @@ public static void Write(Stream stream, int width, int he for (int i = 0; i < height; i++) { writer.Write(offset); - offset += sizeof(int) + ChannelCount * ChannelSize * width; + offset += sizeof(int) + sizeof(int) + ChannelCount * ChannelSize * width; } //Scan lines