mirror of https://git.ffmpeg.org/ffmpeg.git
avutil/common: Fix undefined shift
av_mod_uintp2_c uses a bitwise AND with (1 << p) - 1 to clear the high bits of an unsigned int. But this is undefined if p == 31, because 1 is an int and 2^31 is not representable in an int. So make 1 unsigned. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
This commit is contained in:
parent
e12a2a2d73
commit
ebd25a5ba5
|
@ -240,7 +240,7 @@ static av_always_inline av_const unsigned av_clip_uintp2_c(int a, int p)
|
|||
*/
|
||||
static av_always_inline av_const unsigned av_mod_uintp2_c(unsigned a, unsigned p)
|
||||
{
|
||||
return a & ((1 << p) - 1);
|
||||
return a & ((1U << p) - 1);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in New Issue