From dd31636bd278d7e90b5c80e2c560b66115743d12 Mon Sep 17 00:00:00 2001 From: Ynse Hoornenborg Date: Sun, 9 Jan 2022 16:06:15 +0100 Subject: [PATCH] Correct missing frame counter check --- src/ImageSharp/Formats/Gif/GifEncoderCore.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ImageSharp/Formats/Gif/GifEncoderCore.cs b/src/ImageSharp/Formats/Gif/GifEncoderCore.cs index 17dd03cce3..a21b050a81 100644 --- a/src/ImageSharp/Formats/Gif/GifEncoderCore.cs +++ b/src/ImageSharp/Formats/Gif/GifEncoderCore.cs @@ -330,7 +330,7 @@ namespace SixLabors.ImageSharp.Formats.Gif private void WriteApplicationExtensions(Stream stream, int frameCount, ushort repeatCount, XmpProfile xmpProfile) { // Application Extension: Loop repeat count. - if (repeatCount != 1) + if (frameCount > 1 && repeatCount != 1) { var loopingExtension = new GifNetscapeLoopingApplicationExtension(repeatCount); this.WriteExtension(loopingExtension, stream);