Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit bbe860d5 authored by Marco Nelissen's avatar Marco Nelissen
Browse files

Fix integer overflow in amrwbenc

Bug: 25843966
Change-Id: Ib9b37712819d776496b7a06b9e85c5d1e43f9d25
parent 4aeee811
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -71,6 +71,9 @@ void Preemph2(
		L_tmp = L_deposit_h(x[i]);
		L_tmp -= (x[i - 1] * mu)<<1;
		L_tmp = (L_tmp << 1);
		if (L_tmp > INT32_MAX - 0x8000) {
			L_tmp = INT32_MAX - 0x8000;
		}
		x[i] = (L_tmp + 0x8000)>>16;
	}