get_bits_long: fix variable type

This fixes a theoretical signed overflow

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
Michael Niedermayer 2012-09-30 02:37:40 +02:00
parent 01aa664f21
commit 5f1c3c785c
1 changed files with 2 additions and 2 deletions

View File

@ -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
}