lavc/mediacodec: fix chroma width for yuv420p
authorMatthieu Bouron <matthieu.bouron@stupeflix.com>
Mon, 7 Mar 2016 13:31:25 +0000 (14:31 +0100)
committerMatthieu Bouron <matthieu.bouron@stupeflix.com>
Mon, 7 Mar 2016 13:41:55 +0000 (14:41 +0100)
libavcodec/mediacodec_sw_buffer.c

index df75754..349a68d 100644 (file)
@@ -115,8 +115,8 @@ void ff_mediacodec_sw_buffer_copy_yuv420_planar(AVCodecContext *avctx,
 
             if (i == 0) {
                 width = avctx->width;
-            } else if (i == 1) {
-                width = FFMIN(frame->linesize[i], FFALIGN(avctx->width, 2));
+            } else if (i >= 1) {
+                width = FFMIN(frame->linesize[i], FFALIGN(avctx->width, 2) / 2);
             }
 
             for (j = 0; j < height; j++) {