From 8c4e2a611be96fc49308dbaa7b7e19e7c73c541d Mon Sep 17 00:00:00 2001 From: James Jackson-South Date: Tue, 8 Dec 2015 17:53:16 +1100 Subject: [PATCH] Fix decoder scope issue Former-commit-id: ca50cdd8efb68d5d312dfd8e53852d4f00c1671f Former-commit-id: e9698d8e7c43a772280f46aabf2098897a06c871 Former-commit-id: 6ea60a611bcfca0858972a09ed43d2909b242303 --- .../Formats/Gif/GifDecoderCore.cs | 27 +++++++++---------- 1 file changed, 13 insertions(+), 14 deletions(-) diff --git a/src/ImageProcessor/Formats/Gif/GifDecoderCore.cs b/src/ImageProcessor/Formats/Gif/GifDecoderCore.cs index c7f22d9fa..6c03272ba 100644 --- a/src/ImageProcessor/Formats/Gif/GifDecoderCore.cs +++ b/src/ImageProcessor/Formats/Gif/GifDecoderCore.cs @@ -405,20 +405,19 @@ namespace ImageProcessor.Formats { if (this.graphicsControlExtension.DisposalMethod == DisposalMethod.RestoreToBackground) { - Parallel.For(descriptor.Top, descriptor.Top + descriptor.Height, - y => - { - for (int x = descriptor.Left; x < descriptor.Left + descriptor.Width; x++) - { - offset = ((y * imageWidth) + x) * 4; - - // Stored in r-> g-> b-> a order. - this.currentFrame[offset + 0] = 0; - this.currentFrame[offset + 1] = 0; - this.currentFrame[offset + 2] = 0; - this.currentFrame[offset + 3] = 0; - } - }); + for (int y = descriptor.Top; y < descriptor.Top + descriptor.Height; y++) + { + for (int x = descriptor.Left; x < descriptor.Left + descriptor.Width; x++) + { + offset = ((y * imageWidth) + x) * 4; + + // Stored in r-> g-> b-> a order. + this.currentFrame[offset + 0] = 0; + this.currentFrame[offset + 1] = 0; + this.currentFrame[offset + 2] = 0; + this.currentFrame[offset + 3] = 0; + } + } } else if (this.graphicsControlExtension.DisposalMethod == DisposalMethod.RestoreToPrevious) {