[vlc-commits] vlc_bits: fix overflow in bs_read_ue

Francois Cartegnie git at videolan.org
Wed Nov 2 15:53:17 CET 2016


vlc | branch: master | Francois Cartegnie <fcvlcdev at free.fr> | Wed Nov  2 15:44:47 2016 +0100| [9bad6dda37b904600ec656dd567f9d26a1659538] | committer: Francois Cartegnie

vlc_bits: fix overflow in bs_read_ue

refs #17591

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=9bad6dda37b904600ec656dd567f9d26a1659538
---

 include/vlc_bits.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/include/vlc_bits.h b/include/vlc_bits.h
index bb38363..ed6e717 100644
--- a/include/vlc_bits.h
+++ b/include/vlc_bits.h
@@ -238,7 +238,7 @@ static inline uint32_t bs_read_ue( bs_t * bs )
     while( bs_read1( bs ) == 0 && bs->p < bs->p_end && i < 31 )
         i++;
 
-    return (1 << i) - 1 + bs_read( bs, i );
+    return ((uint32_t)1 << i) - 1 + bs_read( bs, i );
 }
 
 /* Read signed Exp-Golomb code */



More information about the vlc-commits mailing list