summaryrefslogtreecommitdiffstats
path: root/libhb/nlmeans.c
diff options
context:
space:
mode:
authorbradleys <[email protected]>2015-02-16 21:31:14 +0000
committerbradleys <[email protected]>2015-02-16 21:31:14 +0000
commita5dbf52da865d7de0fc721744212a324a4391e08 (patch)
tree9483bffee82b82e20261300ece3076cf90c30e25 /libhb/nlmeans.c
parent32f214a3c0fdca8fd8262dada391d02c723bda70 (diff)
libhb: Fix memory alignment issue in nlmeans.
Solves crash in accelerated code when source dimensions are not mod 16. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@6915 b64f7644-9d1e-0410-96f1-a4d463321fa5
Diffstat (limited to 'libhb/nlmeans.c')
-rw-r--r--libhb/nlmeans.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libhb/nlmeans.c b/libhb/nlmeans.c
index 3d096745e..3da7d7721 100644
--- a/libhb/nlmeans.c
+++ b/libhb/nlmeans.c
@@ -652,7 +652,7 @@ static void nlmeans_plane(NLMeansFunctions *functions,
struct PixelSum *tmp_data = calloc(dst_w * dst_h, sizeof(struct PixelSum));
// Allocate integral image
- const int integral_stride = dst_w + 2 * 16;
+ const int integral_stride = ((dst_w + 15) / 16 * 16) + 2 * 16;
uint32_t* const integral_mem = calloc(integral_stride * (dst_h+1), sizeof(uint32_t));
uint32_t* const integral = integral_mem + integral_stride + 16;