diff --git a/gst-libs/gst/video/video-overlay-composition.c b/gst-libs/gst/video/video-overlay-composition.c
index 4633b6b..e538dc8 100644
--- a/gst-libs/gst/video/video-overlay-composition.c
+++ b/gst-libs/gst/video/video-overlay-composition.c
@@ -69,6 +69,7 @@
 
 #include "video-overlay-composition.h"
 #include "video-blend.h"
+#include <string.h>
 
 struct _GstVideoOverlayComposition
 {
@@ -873,13 +874,17 @@ static void
 gst_video_overlay_rectangle_premultiply (GstBlendVideoFormatInfo * info)
 {
   int i, j;
+  guint8 alpha_channel = 3; /* derive from video-format? */
+  guint8 c1 = (alpha_channel + 1) % MAX_VIDEO_PLANES;
+  guint8 c2 = (alpha_channel + 2) % MAX_VIDEO_PLANES;
+  guint8 c3 = (alpha_channel + 3) % MAX_VIDEO_PLANES;
   for (j = 0; j < info->height; ++j) {
     guint8 *line = info->pixels + info->stride[0] * j;
     for (i = 0; i < info->width; ++i) {
-      int a = line[0];
-      line[1] = line[1] * a / 255;
-      line[2] = line[2] * a / 255;
-      line[3] = line[3] * a / 255;
+      int a = line[alpha_channel];
+      line[c1] = line[c1] * a / 255;
+      line[c2] = line[c2] * a / 255;
+      line[c3] = line[c3] * a / 255;
       line += 4;
     }
   }
@@ -889,14 +894,18 @@ static void
 gst_video_overlay_rectangle_unpremultiply (GstBlendVideoFormatInfo * info)
 {
   int i, j;
+  guint8 alpha_channel = 3; /* derive from video-format? */
+  guint8 c1 = (alpha_channel + 1) % MAX_VIDEO_PLANES;
+  guint8 c2 = (alpha_channel + 2) % MAX_VIDEO_PLANES;
+  guint8 c3 = (alpha_channel + 3) % MAX_VIDEO_PLANES;
   for (j = 0; j < info->height; ++j) {
     guint8 *line = info->pixels + info->stride[0] * j;
     for (i = 0; i < info->width; ++i) {
-      int a = line[0];
+      int a = line[alpha_channel];
       if (a) {
-        line[1] = MIN ((line[1] * 255 + a / 2) / a, 255);
-        line[2] = MIN ((line[2] * 255 + a / 2) / a, 255);
-        line[3] = MIN ((line[3] * 255 + a / 2) / a, 255);
+        line[c1] = MIN ((line[c1] * 255 + a / 2) / a, 255);
+        line[c2] = MIN ((line[c2] * 255 + a / 2) / a, 255);
+        line[c3] = MIN ((line[c3] * 255 + a / 2) / a, 255);
       }
       line += 4;
     }
@@ -910,6 +919,7 @@ gst_video_overlay_rectangle_get_pixels_argb_internal (GstVideoOverlayRectangle *
 {
   GstVideoOverlayRectangle *scaled_rect = NULL;
   GstBlendVideoFormatInfo info;
+  GstVideoOverlayFormatFlags new_flags = rectangle->flags;
   GstBuffer *buf;
   GList *l;
   guint wanted_width = unscaled ? rectangle->width : rectangle->render_width;
@@ -935,7 +945,7 @@ gst_video_overlay_rectangle_get_pixels_argb_internal (GstVideoOverlayRectangle *
 
     if (r->width == wanted_width &&
         r->height == wanted_height &&
-        gst_video_overlay_rectangle_is_same_alpha_type (rectangle->flags,
+        gst_video_overlay_rectangle_is_same_alpha_type (r->flags,
             flags)) {
       /* we'll keep these rectangles around until finalize, so it's ok not
        * to take our own ref here */
@@ -955,13 +965,20 @@ gst_video_overlay_rectangle_get_pixels_argb_internal (GstVideoOverlayRectangle *
 
   if (wanted_width != rectangle->width || wanted_height != rectangle->height) {
     video_blend_scale_linear_RGBA (&info, wanted_height, wanted_width);
+  } else {
+      /* need to clone rectangles pixel-data and update info */
+      guint8 *new_pixels = g_malloc (info.size);
+      memcpy(new_pixels, info.pixels, info.size);
+      info.pixels = new_pixels;
   }
 
   if (!gst_video_overlay_rectangle_is_same_alpha_type (rectangle->flags, flags)) {
     if (rectangle->flags & GST_VIDEO_OVERLAY_FORMAT_FLAG_PREMULTIPLIED_ALPHA) {
       gst_video_overlay_rectangle_unpremultiply (&info);
+      new_flags &= ~GST_VIDEO_OVERLAY_FORMAT_FLAG_PREMULTIPLIED_ALPHA;
     } else {
       gst_video_overlay_rectangle_premultiply (&info);
+      new_flags |= GST_VIDEO_OVERLAY_FORMAT_FLAG_PREMULTIPLIED_ALPHA;
     }
   }
 
@@ -972,7 +989,7 @@ gst_video_overlay_rectangle_get_pixels_argb_internal (GstVideoOverlayRectangle *
 
   scaled_rect = gst_video_overlay_rectangle_new_argb (buf,
       wanted_width, wanted_height, info.stride[0],
-      0, 0, wanted_width, wanted_height, rectangle->flags);
+      0, 0, wanted_width, wanted_height, new_flags);
 
   gst_buffer_unref (buf);
 
