From 6ba2aa7aa14b726ed60390f946cb3789c261263c Mon Sep 17 00:00:00 2001 From: Brian Popow Date: Sat, 18 Jan 2020 17:59:56 +0100 Subject: [PATCH] Fix checking the magick bytes in parsing the VP8 header --- src/ImageSharp/Formats/WebP/WebPDecoderCore.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/ImageSharp/Formats/WebP/WebPDecoderCore.cs b/src/ImageSharp/Formats/WebP/WebPDecoderCore.cs index 415c0a88d3..239755c1f7 100644 --- a/src/ImageSharp/Formats/WebP/WebPDecoderCore.cs +++ b/src/ImageSharp/Formats/WebP/WebPDecoderCore.cs @@ -321,8 +321,8 @@ namespace SixLabors.ImageSharp.Formats.WebP } // Check for VP8 magic bytes. - this.currentStream.Read(this.buffer, 0, 4); - if (!this.buffer.AsSpan(1).SequenceEqual(WebPConstants.Vp8MagicBytes)) + this.currentStream.Read(this.buffer, 0, 3); + if (!this.buffer.AsSpan().Slice(0, 3).SequenceEqual(WebPConstants.Vp8MagicBytes)) { WebPThrowHelper.ThrowImageFormatException("VP8 magic bytes not found"); }