[FFmpeg-cvslog] sws: initialize {src,dst}Stride2 consistently with {src,dst}2

Anton Khirnov git at videolan.org
Sat Jul 3 17:20:11 EEST 2021


ffmpeg | branch: master | Anton Khirnov <anton at khirnov.net> | Wed May 19 11:50:28 2021 +0200| [c05cab34a9d53c6b948e3757385b9c2657608603] | committer: Anton Khirnov

sws: initialize {src,dst}Stride2 consistently with {src,dst}2

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=c05cab34a9d53c6b948e3757385b9c2657608603
---

 libswscale/swscale.c | 11 ++++-------
 1 file changed, 4 insertions(+), 7 deletions(-)

diff --git a/libswscale/swscale.c b/libswscale/swscale.c
index 7dbe0f59c5..1cf89e4684 100644
--- a/libswscale/swscale.c
+++ b/libswscale/swscale.c
@@ -883,11 +883,6 @@ int attribute_align_arg sws_scale(struct SwsContext *c,
         return AVERROR(EINVAL);
     }
 
-    for (i=0; i<4; i++) {
-        srcStride2[i] = srcStride[i];
-        dstStride2[i] = dstStride[i];
-    }
-
     if ((srcSliceY & (macro_height-1)) ||
         ((srcSliceH& (macro_height-1)) && srcSliceY + srcSliceH != c->srcH) ||
         srcSliceY + srcSliceH > c->srcH) {
@@ -901,8 +896,10 @@ int attribute_align_arg sws_scale(struct SwsContext *c,
     if (c->cascaded_context[0] && srcSliceY == 0 && srcSliceH == c->cascaded_context[0]->srcH)
         return scale_cascaded(c, srcSlice, srcStride, srcSliceY, srcSliceH, dst, dstStride);
 
-    memcpy(src2, srcSlice, sizeof(src2));
-    memcpy(dst2, dst, sizeof(dst2));
+    memcpy(src2,       srcSlice,  sizeof(src2));
+    memcpy(dst2,       dst,       sizeof(dst2));
+    memcpy(srcStride2, srcStride, sizeof(srcStride2));
+    memcpy(dstStride2, dstStride, sizeof(dstStride2));
 
     // do not mess up sliceDir if we have a "trailing" 0-size slice
     if (srcSliceH == 0)



More information about the ffmpeg-cvslog mailing list