From 49a40c08f1571213d9f86dc4f155309a17c9e7e3 Mon Sep 17 00:00:00 2001 From: Clinton Ingram Date: Thu, 27 Apr 2023 15:22:51 -0700 Subject: [PATCH] fix undefined last row in planar WebP encoder --- src/NativeCodecs/Libwebp/WebpEncoder.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/NativeCodecs/Libwebp/WebpEncoder.cs b/src/NativeCodecs/Libwebp/WebpEncoder.cs index 3e692dc0..99468c96 100644 --- a/src/NativeCodecs/Libwebp/WebpEncoder.cs +++ b/src/NativeCodecs/Libwebp/WebpEncoder.cs @@ -149,7 +149,7 @@ public void WriteFrame(IPixelSource source, IMetadataSource metadata, Rectangle srcV.CopyPixels(areaUV.Slice(lastc, incc), picture.uv_stride, spanV.Slice(lastc * picture.uv_stride)); } - if (lasty < area.Height - 1) + if (lasty < area.Height) { srcY.CopyPixels(area.Slice(lasty), picture.y_stride, spanY.Slice(lasty * picture.y_stride)); srcU.CopyPixels(areaUV.Slice(lastc), picture.uv_stride, spanU.Slice(lastc * picture.uv_stride));