Skip to content

Commit e7ce5fa

Browse files
committed
Astc files are little endian
1 parent 94d0f72 commit e7ce5fa

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/ImageSharp.Textures/Compression/Astc/IO/AstcFileHeader.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
// Copyright (c) Six Labors.
22
// Licensed under the Six Labors Split License.
33

4+
using System.Buffers.Binary;
5+
46
namespace SixLabors.ImageSharp.Textures.Compression.Astc.IO;
57

68
/// <summary>
@@ -27,7 +29,7 @@ public static AstcFileHeader FromMemory(Span<byte> data)
2729
// - magic (4),
2830
// - blockdim (3),
2931
// - xsize,y,z (each 3 little-endian bytes)
30-
uint magic = BitConverter.ToUInt32(data);
32+
uint magic = BinaryPrimitives.ReadUInt32LittleEndian(data);
3133
ArgumentOutOfRangeException.ThrowIfNotEqual(magic, Magic);
3234

3335
return new AstcFileHeader(

0 commit comments

Comments
 (0)