compositor: fix YUY2/UYVY/VYUY blending
authorMatthew Waters <matthew@centricular.com>
Mon, 21 Sep 2020 13:50:03 +0000 (23:50 +1000)
committerMatthew Waters <matthew@centricular.com>
Mon, 21 Sep 2020 13:51:31 +0000 (23:51 +1000)
Don't overead memory.

Fixup for https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/-/merge_requests/755

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/-/merge_requests/823>

gst/compositor/blend.c

index 6eeba1c..c2c0150 100644 (file)
@@ -969,8 +969,8 @@ blend_##name (GstVideoFrame * srcframe, gint xpos, gint ypos, \
     xpos = 0; \
   } \
   if (ypos < dst_y_start) { \
-    src += -ypos * src_stride; \
-    src_height -= -ypos; \
+    src += (dst_y_start - ypos) * src_stride; \
+    src_height -= dst_y_start - ypos; \
     ypos = dst_y_start; \
   } \
   \