Browse Source

Make skipblock static to fix build

pull/2346/head
Stefan Nikolei 4 years ago
parent
commit
90ac3a29c9
  1. 18
      src/ImageSharp/Formats/Gif/GifDecoderCore.cs

18
src/ImageSharp/Formats/Gif/GifDecoderCore.cs

@ -140,7 +140,7 @@ internal sealed class GifDecoderCore : IImageDecoderInternals
this.ReadApplicationExtension(stream); this.ReadApplicationExtension(stream);
break; break;
case GifConstants.PlainTextLabel: case GifConstants.PlainTextLabel:
this.SkipBlock(stream); // Not supported by any known decoder. SkipBlock(stream); // Not supported by any known decoder.
break; break;
} }
} }
@ -189,7 +189,7 @@ internal sealed class GifDecoderCore : IImageDecoderInternals
switch (stream.ReadByte()) switch (stream.ReadByte())
{ {
case GifConstants.GraphicControlLabel: case GifConstants.GraphicControlLabel:
this.SkipBlock(stream); // Skip graphic control extension block SkipBlock(stream); // Skip graphic control extension block
break; break;
case GifConstants.CommentLabel: case GifConstants.CommentLabel:
this.ReadComments(stream); this.ReadComments(stream);
@ -198,7 +198,7 @@ internal sealed class GifDecoderCore : IImageDecoderInternals
this.ReadApplicationExtension(stream); this.ReadApplicationExtension(stream);
break; break;
case GifConstants.PlainTextLabel: case GifConstants.PlainTextLabel:
this.SkipBlock(stream); // Not supported by any known decoder. SkipBlock(stream); // Not supported by any known decoder.
break; break;
} }
} }
@ -307,7 +307,7 @@ internal sealed class GifDecoderCore : IImageDecoderInternals
{ {
// Reset the stream position and continue. // Reset the stream position and continue.
stream.Position = position; stream.Position = position;
this.SkipBlock(stream, appLength); SkipBlock(stream, appLength);
} }
return; return;
@ -327,12 +327,12 @@ internal sealed class GifDecoderCore : IImageDecoderInternals
// Could be something else not supported yet. // Could be something else not supported yet.
// Skip the subblock and terminator. // Skip the subblock and terminator.
this.SkipBlock(stream, subBlockSize); SkipBlock(stream, subBlockSize);
return; return;
} }
this.SkipBlock(stream, appLength); // Not supported by any known decoder. SkipBlock(stream, appLength); // Not supported by any known decoder.
} }
/// <summary> /// <summary>
@ -340,7 +340,7 @@ internal sealed class GifDecoderCore : IImageDecoderInternals
/// <param name="blockSize">The length of the block to skip.</param> /// <param name="blockSize">The length of the block to skip.</param>
/// <param name="stream">The <see cref="BufferedReadStream"/> containing image data.</param> /// <param name="stream">The <see cref="BufferedReadStream"/> containing image data.</param>
/// </summary> /// </summary>
private void SkipBlock(BufferedReadStream stream, int blockSize = 0) private static void SkipBlock(BufferedReadStream stream, int blockSize = 0)
{ {
if (blockSize > 0) if (blockSize > 0)
{ {
@ -363,7 +363,7 @@ internal sealed class GifDecoderCore : IImageDecoderInternals
{ {
int length; int length;
var stringBuilder = new StringBuilder(); StringBuilder stringBuilder = new StringBuilder();
while ((length = stream.ReadByte()) != 0) while ((length = stream.ReadByte()) != 0)
{ {
if (length > GifConstants.MaxCommentSubBlockLength) if (length > GifConstants.MaxCommentSubBlockLength)
@ -432,7 +432,7 @@ internal sealed class GifDecoderCore : IImageDecoderInternals
this.ReadFrameColors(ref image, ref previousFrame, indices, colorTable, this.imageDescriptor); this.ReadFrameColors(ref image, ref previousFrame, indices, colorTable, this.imageDescriptor);
// Skip any remaining blocks // Skip any remaining blocks
this.SkipBlock(stream); SkipBlock(stream);
} }
finally finally
{ {

Loading…
Cancel
Save