mirror of https://git.ffmpeg.org/ffmpeg.git
g723_1: fix overflow in square_root()
the intermediate does not fit in a signed 32bit int Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
parent
2fed05f53a
commit
014b178f84
|
@ -226,8 +226,10 @@ static int unpack_bitstream(G723_1_Context *p, const uint8_t *buf,
|
||||||
/**
|
/**
|
||||||
* Bitexact implementation of sqrt(val/2).
|
* Bitexact implementation of sqrt(val/2).
|
||||||
*/
|
*/
|
||||||
static int16_t square_root(int val)
|
static int16_t square_root(unsigned val)
|
||||||
{
|
{
|
||||||
|
av_assert2(!(val & 0x80000000));
|
||||||
|
|
||||||
return (ff_sqrt(val << 1) >> 1) & (~1);
|
return (ff_sqrt(val << 1) >> 1) & (~1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue