base64: fix signed overflow in shift
authorMans Rullgard <mans@mansr.com>
Sat, 24 Nov 2012 13:03:53 +0000 (13:03 +0000)
committerMans Rullgard <mans@mansr.com>
Mon, 26 Nov 2012 13:34:58 +0000 (13:34 +0000)
Signed-off-by: Mans Rullgard <mans@mansr.com>
libavutil/base64.c

index 73872b8..c1fba89 100644 (file)
@@ -44,10 +44,10 @@ static const uint8_t map2[] =
 
 int av_base64_decode(uint8_t *out, const char *in, int out_size)
 {
-    int i, v;
+    int i;
+    unsigned v = 0;
     uint8_t *dst = out;
 
-    v = 0;
     for (i = 0; in[i] && in[i] != '='; i++) {
         unsigned int index= in[i]-43;
         if (index>=FF_ARRAY_ELEMS(map2) || map2[index] == 0xff)