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
This commit is contained in:
DRC
2015-01-14 13:07:06 +00:00
parent 2517ef72ed
commit 11c4010c3c

View File

@@ -205,7 +205,7 @@ void jsimd_ycc_rgb_convert_altivec (JDIMENSION out_width, JSAMPIMAGE input_buf,
/* Fast path */ /* Fast path */
unaligned_shift_index = vec_lvsl(0, outptr); unaligned_shift_index = vec_lvsl(0, outptr);
edgel = vec_ld(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); edges = vec_perm(edgeh, edgel, unaligned_shift_index);
unaligned_shift_index = vec_lvsr(0, outptr); unaligned_shift_index = vec_lvsr(0, outptr);
out0 = vec_perm(edges, rgb0, unaligned_shift_index); out0 = vec_perm(edges, rgb0, unaligned_shift_index);