From b8a047d4b592bfe2badd465d167d5c293d4b243e Mon Sep 17 00:00:00 2001 From: James Jackson-South Date: Sat, 12 Aug 2017 19:47:04 +1000 Subject: [PATCH] Fix #281 --- src/ImageSharp/Formats/Gif/GifDecoderCore.cs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/ImageSharp/Formats/Gif/GifDecoderCore.cs b/src/ImageSharp/Formats/Gif/GifDecoderCore.cs index bb230beac..948103fed 100644 --- a/src/ImageSharp/Formats/Gif/GifDecoderCore.cs +++ b/src/ImageSharp/Formats/Gif/GifDecoderCore.cs @@ -157,6 +157,10 @@ namespace ImageSharp.Formats } nextFlag = stream.ReadByte(); + if (nextFlag == -1) + { + break; + } } } finally