swresample/rematrix_template: Fix integer overflow in mix6to2

Fixes: CID1030351
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
Michael Niedermayer 2013-06-10 02:39:48 +02:00
parent 052838f765
commit b04bbe6b86

View File

@ -66,7 +66,7 @@ static void RENAME(mix6to2)(SAMPLE **out, const SAMPLE **in, COEFF *coeffp, inte
int i; int i;
for(i=0; i<len; i++) { for(i=0; i<len; i++) {
INTER t = in[2][i]*coeffp[0*6+2] + in[3][i]*coeffp[0*6+3]; INTER t = in[2][i]*(INTER)coeffp[0*6+2] + in[3][i]*(INTER)coeffp[0*6+3];
out[0][i] = R(t + in[0][i]*(INTER)coeffp[0*6+0] + in[4][i]*(INTER)coeffp[0*6+4]); out[0][i] = R(t + in[0][i]*(INTER)coeffp[0*6+0] + in[4][i]*(INTER)coeffp[0*6+4]);
out[1][i] = R(t + in[1][i]*(INTER)coeffp[1*6+1] + in[5][i]*(INTER)coeffp[1*6+5]); out[1][i] = R(t + in[1][i]*(INTER)coeffp[1*6+1] + in[5][i]*(INTER)coeffp[1*6+5]);
} }