From dd3b73f3905c61c99f1d3fb58bc7ee380eb8aa2e Mon Sep 17 00:00:00 2001 From: Mans Rullgard Date: Sat, 24 Nov 2012 13:03:53 +0000 Subject: [PATCH] base64: fix signed overflow in shift Signed-off-by: Mans Rullgard --- libavutil/base64.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libavutil/base64.c b/libavutil/base64.c index 73872b8c99..c1fba897be 100644 --- a/libavutil/base64.c +++ b/libavutil/base64.c @@ -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)