---
 gst/ffmpegcolorspace/gstffmpegcodecmap.c |   11 +++--------
 1 file changed, 3 insertions(+), 8 deletions(-)

--- gst-plugins-base.orig/gst/ffmpegcolorspace/gstffmpegcodecmap.c
+++ gst-plugins-base/gst/ffmpegcolorspace/gstffmpegcodecmap.c
@@ -814,19 +814,14 @@
     case PIX_FMT_NV12:
     case PIX_FMT_NV21:
       stride = GST_ROUND_UP_4 (width);
-      h2 = ROUND_UP_X (height, pinfo->y_chroma_shift);
-      size = stride * h2;
-      w2 = 2 * DIV_ROUND_UP_X (width, pinfo->x_chroma_shift);
-      stride2 = GST_ROUND_UP_4 (w2);
-      h2 = DIV_ROUND_UP_X (height, pinfo->y_chroma_shift);
-      size2 = stride2 * h2;
+      size = stride * GST_ROUND_UP_2 (height);
       picture->data[0] = ptr;
       picture->data[1] = picture->data[0] + size;
       picture->data[2] = NULL;
       picture->linesize[0] = stride;
-      picture->linesize[1] = stride2;
+      picture->linesize[1] = stride;
       picture->linesize[2] = 0;
-      return size + size2;
+      return size + (stride * height) / 2;
     case PIX_FMT_RGB24:
     case PIX_FMT_BGR24:
       stride = GST_ROUND_UP_4 (width * 3);
