[vlc-commits] vlc_b64_encode: fix signed integer overflow

Rémi Denis-Courmont git at videolan.org
Tue Aug 30 20:54:41 CEST 2016


vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Tue Aug 30 21:29:28 2016 +0300| [43e53612706d0e762e0ee74c1a3f51610768a8e9] | committer: Rémi Denis-Courmont

vlc_b64_encode: fix signed integer overflow

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

 src/text/strings.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/text/strings.c b/src/text/strings.c
index 5ebf46c..e27ca42 100644
--- a/src/text/strings.c
+++ b/src/text/strings.c
@@ -352,7 +352,7 @@ char *vlc_b64_encode_binary( const uint8_t *src, size_t i_src )
         uint32_t v;
 
         /* 1/3 -> 1/4 */
-        v = *src++ << 24;
+        v = ((unsigned)*src++) << 24;
         *dst++ = b64[v >> 26];
         v = v << 6;
 



More information about the vlc-commits mailing list