Skip to content

Commit df803cd

Browse files
committed
Fix nullref
the quantizier was initialized with default --> all properties are null. So we need to check that
1 parent eedaa28 commit df803cd

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/ImageSharp/Formats/Gif/GifEncoderCore.cs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,10 @@ private void EncodeFrames<TPixel>(
171171
quantized = null;
172172
}
173173

174-
paletteQuantizer.Dispose();
174+
if (hasPaletteQuantizer)
175+
{
176+
paletteQuantizer.Dispose();
177+
}
175178
}
176179

177180
private void EncodeFrame<TPixel>(

0 commit comments

Comments
 (0)