]> git.sesse.net Git - ffmpeg/blobdiff - libavcodec/v210enc.c
Merge remote-tracking branch 'qatar/master'
[ffmpeg] / libavcodec / v210enc.c
index 92577ef80f8c0fcfa48ae1588795a66f00cfd324..1a78aa24757ed4e494f94446e1fe45bb971be733 100644 (file)
@@ -90,13 +90,13 @@ static int encode_frame(AVCodecContext *avctx, unsigned char *buf,
             val = CLIP(*y++);
             if (w == avctx->width - 2)
                 bytestream_put_le32(&p, val);
-        }
-        if (w < avctx->width - 3) {
-            val |= (CLIP(*u++) << 10) | (CLIP(*y++) << 20);
-            bytestream_put_le32(&p, val);
+            if (w < avctx->width - 3) {
+                val |= (CLIP(*u++) << 10) | (CLIP(*y++) << 20);
+                bytestream_put_le32(&p, val);
 
-            val = CLIP(*v++) | (CLIP(*y++) << 10);
-            bytestream_put_le32(&p, val);
+                val = CLIP(*v++) | (CLIP(*y++) << 10);
+                bytestream_put_le32(&p, val);
+            }
         }
 
         pdst += stride;