[PATCH] fixed #1973
authorjeanlf <jeanlf@gpac.io>
Tue, 14 Dec 2021 10:34:46 +0000 (11:34 +0100)
committerAron Xu <aron@debian.org>
Tue, 23 May 2023 11:53:25 +0000 (12:53 +0100)
Gbp-Pq: Name CVE-2021-45297.patch

src/utils/math.c

index 6ac222aacdabe779619214408cd75753dc281d97..7ee997e620426b956b29bcf3d15081bc7ae367c2 100644 (file)
@@ -35,7 +35,8 @@ GF_EXPORT
 u32 gf_get_bit_size(u32 MaxVal)
 {
        u32 k=0;
-       while ((s32) MaxVal > ((1<<k)-1) ) k+=1;
+       while (MaxVal > (((u32)1<<k)-1) )
+               k+=1;
        return k;
 }