libavcodec/ppc/mpegvideoencdsp.c: fix stack smashing in pix_norm1_altivec() and pix_sum_altivec()
The vec_ste calls were mistakenly changed to vec_vsx_st inc5ca76a
, which caused stack smashing. Changing them back fixes crashes on ppc64el, when configured with --toolchain=hardened. Signed-off-by: Michael Niedermayer <michaelni@gmx.at> (cherry picked from commit840c3c0531
) Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:

committed by
Michael Niedermayer

parent
a443b48ccf
commit
a45b8af839
@@ -55,7 +55,7 @@ static int pix_norm1_altivec(uint8_t *pix, int line_size)
|
|||||||
/* Sum up the four partial sums, and put the result into s. */
|
/* Sum up the four partial sums, and put the result into s. */
|
||||||
sum = vec_sums((vector signed int) sv, (vector signed int) zero);
|
sum = vec_sums((vector signed int) sv, (vector signed int) zero);
|
||||||
sum = vec_splat(sum, 3);
|
sum = vec_splat(sum, 3);
|
||||||
vec_vsx_st(sum, 0, &s);
|
vec_ste(sum, 0, &s);
|
||||||
return s;
|
return s;
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
@@ -113,7 +113,7 @@ static int pix_sum_altivec(uint8_t *pix, int line_size)
|
|||||||
/* Sum up the four partial sums, and put the result into s. */
|
/* Sum up the four partial sums, and put the result into s. */
|
||||||
sumdiffs = vec_sums((vector signed int) sad, (vector signed int) zero);
|
sumdiffs = vec_sums((vector signed int) sad, (vector signed int) zero);
|
||||||
sumdiffs = vec_splat(sumdiffs, 3);
|
sumdiffs = vec_splat(sumdiffs, 3);
|
||||||
vec_vsx_st(sumdiffs, 0, &s);
|
vec_ste(sumdiffs, 0, &s);
|
||||||
return s;
|
return s;
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
|
Reference in New Issue
Block a user