Skip to content

Commit 4532194

Browse files
committed
Block8x8 set explicit size instead of (unused) fixed sized buffer field
1 parent a4ad7b0 commit 4532194

File tree

1 file changed

+2
-13
lines changed

1 file changed

+2
-13
lines changed

src/ImageSharp/Formats/Jpeg/Components/Block8x8.cs

Lines changed: 2 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -15,25 +15,14 @@ namespace SixLabors.ImageSharp.Formats.Jpeg.Components;
1515
/// 8x8 matrix of <see cref="short"/> coefficients.
1616
/// </summary>
1717
// ReSharper disable once InconsistentNaming
18-
[StructLayout(LayoutKind.Explicit)]
19-
internal unsafe partial struct Block8x8
18+
[StructLayout(LayoutKind.Explicit, Size = 2 * Size)]
19+
internal partial struct Block8x8
2020
{
2121
/// <summary>
2222
/// A number of scalar coefficients in a <see cref="Block8x8F"/>
2323
/// </summary>
2424
public const int Size = 64;
2525

26-
#pragma warning disable IDE0051 // Remove unused private member
27-
/// <summary>
28-
/// A placeholder buffer so the actual struct occupies exactly 64 * 2 bytes.
29-
/// </summary>
30-
/// <remarks>
31-
/// This is not used directly in the code.
32-
/// </remarks>
33-
[FieldOffset(0)]
34-
private fixed short data[Size];
35-
#pragma warning restore IDE0051
36-
3726
/// <summary>
3827
/// Gets or sets a <see cref="short"/> value at the given index
3928
/// </summary>

0 commit comments

Comments
 (0)