Browse Source

Fixing bytes struct reference issue.

pull/49/head
Olivia 9 years ago
parent
commit
fb9103aeaf
  1. 6
      src/ImageSharp/Formats/Jpg/Components/Bits.cs
  2. 7
      src/ImageSharp/Formats/Jpg/JpegDecoderCore.cs

6
src/ImageSharp/Formats/Jpg/Components/Bits.cs

@ -45,7 +45,11 @@ namespace ImageSharp.Formats
{
JpegDecoderCore.ErrorCodes errorCode;
byte c = decoder.Bytes.ReadByteStuffedByte(decoder.InputStream, out errorCode);
// Grab the decode bytes, use them and then set them
// back on the decoder.
var decoderBytes = decoder.Bytes;
byte c = decoderBytes.ReadByteStuffedByte(decoder.InputStream, out errorCode);
decoder.Bytes = decoderBytes;
if (errorCode != JpegDecoderCore.ErrorCodes.NoError)
{

7
src/ImageSharp/Formats/Jpg/JpegDecoderCore.cs

@ -236,7 +236,7 @@ namespace ImageSharp.Formats
}
/// <summary>
/// Gets the byte buffer.
/// Gets or sets the byte buffer.
/// </summary>
public Bytes Bytes
{
@ -244,6 +244,11 @@ namespace ImageSharp.Formats
{
return this.bytes;
}
set
{
this.bytes = value;
}
}
/// <summary>

Loading…
Cancel
Save