summaryrefslogtreecommitdiff
path: root/libswscale
diff options
context:
space:
mode:
authorSean McGovern <gseanmcg@gmail.com>2011-11-10 19:16:58 -0500
committerRonald S. Bultje <rsbultje@gmail.com>2011-11-11 07:44:35 -0800
commit124e56454dc9adbcc20fcf124785865549e04d7a (patch)
tree133afdd2e6870d2c4bc5dd49581a9e80e3d73581 /libswscale
parentb8a1b880ee155f4f27389f7f76a58a1d87eb7008 (diff)
swscale: add padding to conversion buffer.
Altivec does unaligned reads from this buffer in hscale_altivec_real(), and can thus read up to 16 bytes beyond the end of the buffer. Therefore, add an extra 16 bytes of padding at the end of the conversion buffer. This fixes fate-lavfi-pixfmts_scale on AltiVec-enabled builds under valgrind. Signed-off-by: Ronald S. Bultje <rsbultje@gmail.com>
Diffstat (limited to 'libswscale')
-rw-r--r--libswscale/utils.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libswscale/utils.c b/libswscale/utils.c
index 862b2736f6..51bec62717 100644
--- a/libswscale/utils.c
+++ b/libswscale/utils.c
@@ -871,7 +871,7 @@ int sws_init_context(SwsContext *c, SwsFilter *srcFilter, SwsFilter *dstFilter)
if (c->dstBpc == 16)
dst_stride <<= 1;
FF_ALLOC_OR_GOTO(c, c->formatConvBuffer,
- FFALIGN(srcW, 16) * 2 * FFALIGN(c->srcBpc, 8) >> 3,
+ (FFALIGN(srcW, 16) * 2 * FFALIGN(c->srcBpc, 8) >> 3) + 16,
fail);
if (HAVE_MMX2 && cpu_flags & AV_CPU_FLAG_MMX2 && c->srcBpc == 8 && c->dstBpc <= 10) {
c->canMMX2BeUsed= (dstW >=srcW && (dstW&31)==0 && (srcW&15)==0) ? 1 : 0;