Merge pull request #2719 from SixLabors/backport/v2-check-palette-ind… · SixLabors/ImageSharp@a78ce27 · GitHub
Skip to content

Commit a78ce27

Browse files
Merge pull request #2719 from SixLabors/backport/v2-check-palette-indices
V2 - Limit Read Palette Indices
2 parents fa7d712 + e620914 commit a78ce27

4 files changed

Lines changed: 17 additions & 3 deletions

File tree

‎src/ImageSharp/Formats/Png/PngScanlineProcessor.cs‎

Lines changed: 4 additions & 3 deletions

‎tests/ImageSharp.Tests/Formats/Png/PngDecoderTests.cs‎

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -526,5 +526,13 @@ static void RunTest(string providerDump, string nonContiguousBuffersStr)
526526
"Disco")
527527
.Dispose();
528528
}
529+
530+
[Theory]
531+
[InlineData(TestImages.Png.Bad.Issue2714BadPalette)]
532+
public void Decode_BadPalette(string file)
533+
{
534+
string path = Path.GetFullPath(Path.Combine(TestEnvironment.InputImagesDirectoryFullPath, file));
535+
using Image image = Image.Load(path);
536+
}
529537
}
530538
}

‎tests/ImageSharp.Tests/TestImages.cs‎

Lines changed: 2 additions & 0 deletions
Lines changed: 3 additions & 0 deletions
Loading

0 commit comments

Comments
 (0)