diff --git a/src/ImageSharp/Formats/Jpeg/Components/Decoder/QualityEvaluator.cs b/src/ImageSharp/Formats/Jpeg/Components/Decoder/QualityEvaluator.cs index 938459b88..8c014ecda 100644 --- a/src/ImageSharp/Formats/Jpeg/Components/Decoder/QualityEvaluator.cs +++ b/src/ImageSharp/Formats/Jpeg/Components/Decoder/QualityEvaluator.cs @@ -1,4 +1,4 @@ -// Copyright (c) Six Labors. +// Copyright (c) Six Labors. // Licensed under the Apache License, Version 2.0. namespace SixLabors.ImageSharp.Formats.Jpeg.Components.Decoder @@ -78,6 +78,8 @@ namespace SixLabors.ImageSharp.Formats.Jpeg.Components.Decoder /// The . public static int EstimateQuality(Block8x8F[] quantizationTables) { + DebugGuard.MustBeGreaterThan(quantizationTables.Length, 2, nameof(quantizationTables)); + int quality = 75; float sum = 0; @@ -141,4 +143,4 @@ namespace SixLabors.ImageSharp.Formats.Jpeg.Components.Decoder return quality; } } -} \ No newline at end of file +}