From 36ec32e45d3a86cc9591ae6e9c69d99c63394b39 Mon Sep 17 00:00:00 2001 From: Jason Nelson Date: Tue, 17 Apr 2018 14:43:09 -0700 Subject: [PATCH] Ensure we pass exactly 40 bytes when parsing the BmpHeader --- src/ImageSharp/Formats/Bmp/BmpDecoderCore.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ImageSharp/Formats/Bmp/BmpDecoderCore.cs b/src/ImageSharp/Formats/Bmp/BmpDecoderCore.cs index 40674ddf1c..26bd97b810 100644 --- a/src/ImageSharp/Formats/Bmp/BmpDecoderCore.cs +++ b/src/ImageSharp/Formats/Bmp/BmpDecoderCore.cs @@ -498,7 +498,7 @@ namespace SixLabors.ImageSharp.Formats.Bmp else if (headerSize >= BmpInfoHeader.Size) { // >= 40 bytes - this.infoHeader = BmpInfoHeader.Parse(buffer); + this.infoHeader = BmpInfoHeader.Parse(buffer.AsSpan(0, 40)); } else {