]> git.sesse.net Git - ffmpeg/blobdiff - libavcodec/mediacodec_sw_buffer.c
avcodec/tak_parser: fix parsing of streams with bunch of small frames at end
[ffmpeg] / libavcodec / mediacodec_sw_buffer.c
index df75754ba22df2a7ba639a6f57895223ffdadb5c..7baf1205397bc2c4ba7d2c84619c5c7b9427c548 100644 (file)
@@ -37,7 +37,7 @@
 #define QCOM_TILE_GROUP_SIZE (4 * QCOM_TILE_SIZE)
 
 /**
- * The code handling the the various YUV color formats is taken from the
+ * The code handling the various YUV color formats is taken from the
  * GStreamer project.
  *
  * Gstreamer reference:
@@ -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++) {