From 11c4010c3c22544e775228d6a9653be2b3f2e77c Mon Sep 17 00:00:00 2001 From: DRC Date: Wed, 14 Jan 2015 13:07:06 +0000 Subject: [PATCH] Fix an overread detected by valgrind git-svn-id: svn+ssh://svn.code.sf.net/p/libjpeg-turbo/code/trunk@1502 632fc199-4ca6-4c93-a231-07263d6284db --- simd/jdcolext-altivec.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/simd/jdcolext-altivec.c b/simd/jdcolext-altivec.c index 2c52dd7..1b8311d 100644 --- a/simd/jdcolext-altivec.c +++ b/simd/jdcolext-altivec.c @@ -205,7 +205,7 @@ void jsimd_ycc_rgb_convert_altivec (JDIMENSION out_width, JSAMPIMAGE input_buf, /* Fast path */ unaligned_shift_index = vec_lvsl(0, outptr); edgel = vec_ld(0, outptr); - edgeh = vec_ld(min(num_cols, RGB_PIXELSIZE * 16) + offset, outptr); + edgeh = vec_ld(min(num_cols - 1, RGB_PIXELSIZE * 16), outptr); edges = vec_perm(edgeh, edgel, unaligned_shift_index); unaligned_shift_index = vec_lvsr(0, outptr); out0 = vec_perm(edges, rgb0, unaligned_shift_index); -- 2.40.0