From 5f1c3c785c786f3c78c350d4503fcfd794fa3c64 Mon Sep 17 00:00:00 2001 From: Michael Niedermayer Date: Sun, 30 Sep 2012 02:37:40 +0200 Subject: [PATCH] get_bits_long: fix variable type This fixes a theoretical signed overflow Signed-off-by: Michael Niedermayer --- libavcodec/get_bits.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libavcodec/get_bits.h b/libavcodec/get_bits.h index d926f57575..0aabca23cc 100644 --- a/libavcodec/get_bits.h +++ b/libavcodec/get_bits.h @@ -306,10 +306,10 @@ static inline unsigned int get_bits_long(GetBitContext *s, int n) return get_bits(s, n); else { #ifdef BITSTREAM_READER_LE - int ret = get_bits(s, 16); + unsigned ret = get_bits(s, 16); return ret | (get_bits(s, n-16) << 16); #else - int ret = get_bits(s, 16) << (n-16); + unsigned ret = get_bits(s, 16) << (n-16); return ret | get_bits(s, n-16); #endif }