[FFmpeg-cvslog] sws/packed_16bpc_bswap: fix handling of negative stride

Michael Niedermayer git at videolan.org
Sun May 12 17:30:28 CEST 2013


ffmpeg | branch: master | Michael Niedermayer <michaelni at gmx.at> | Sun May 12 17:26:15 2013 +0200| [91f4a44ff4fa55e0a48f71c432a1dc3158d662b9] | committer: Michael Niedermayer

sws/packed_16bpc_bswap: fix handling of negative stride

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

 libswscale/swscale_unscaled.c |    6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/libswscale/swscale_unscaled.c b/libswscale/swscale_unscaled.c
index 8889183..e0a5851 100644
--- a/libswscale/swscale_unscaled.c
+++ b/libswscale/swscale_unscaled.c
@@ -324,11 +324,11 @@ static int packed_16bpc_bswap(SwsContext *c, const uint8_t *src[],
     int i, j, p;
 
     for (p = 0; p < 4; p++) {
-        int srcstr = srcStride[p] >> 1;
-        int dststr = dstStride[p] >> 1;
+        int srcstr = srcStride[p] / 2;
+        int dststr = dstStride[p] / 2;
         uint16_t       *dstPtr =       (uint16_t *) dst[p];
         const uint16_t *srcPtr = (const uint16_t *) src[p];
-        int min_stride         = FFMIN(srcstr, dststr);
+        int min_stride         = FFMIN(FFABS(srcstr), FFABS(dststr));
         if(!dstPtr || !srcPtr)
             continue;
         for (i = 0; i < (srcSliceH >> c->chrDstVSubSample); i++) {



More information about the ffmpeg-cvslog mailing list