[FFmpeg-cvslog] swscale: allocate larger buffer to handle altivec overreads.

Ronald S. Bultje git at videolan.org
Fri Jun 3 05:24:55 CEST 2011


ffmpeg | branch: master | Ronald S. Bultje <rsbultje at gmail.com> | Thu Jun  2 11:25:56 2011 -0700| [808d8ff6bb92e641cdd99a0b06767eabd707b925] | committer: Ronald S. Bultje

swscale: allocate larger buffer to handle altivec overreads.

Altivec sws code intentionally overreads buffers for better performance,
so we need to allocate larger buffers to handle that.

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

 libswscale/utils.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/libswscale/utils.c b/libswscale/utils.c
index a2a6a1e..827abc6 100644
--- a/libswscale/utils.c
+++ b/libswscale/utils.c
@@ -749,7 +749,7 @@ int sws_init_context(SwsContext *c, SwsFilter *srcFilter, SwsFilter *dstFilter)
     int srcH= c->srcH;
     int dstW= c->dstW;
     int dstH= c->dstH;
-    int dst_stride = FFALIGN(dstW * sizeof(int16_t), 16), dst_stride_px = dst_stride >> 1;
+    int dst_stride = FFALIGN(dstW * sizeof(int16_t) + 16, 16), dst_stride_px = dst_stride >> 1;
     int flags, cpu_flags;
     enum PixelFormat srcFormat= c->srcFormat;
     enum PixelFormat dstFormat= c->dstFormat;



More information about the ffmpeg-cvslog mailing list