diff --git a/FFMpegCore.Test/Utilities/BitmapSources.cs b/FFMpegCore.Test/Utilities/BitmapSources.cs index 755f781..8965435 100644 --- a/FFMpegCore.Test/Utilities/BitmapSources.cs +++ b/FFMpegCore.Test/Utilities/BitmapSources.cs @@ -50,10 +50,11 @@ public static Extensions.SkiaSharp.BitmapVideoFrameWrapper CreateVideoFrame(int { var bitmap = new SKBitmap(w, h, fmt, SKAlphaType.Opaque); + using var bitmapCanvas = new SKCanvas(bitmap); SetVideoFramePixels(index, w, h, scaleNoise, offset, ((int x, int y, byte red, byte green, byte blue) args) => { var color = new SKColor(args.red, args.blue, args.green); - bitmap.SetPixel(args.x, args.y, color); + bitmapCanvas.DrawPoint(args.x, args.y, color); }); return new Extensions.SkiaSharp.BitmapVideoFrameWrapper(bitmap);