diff --git a/include/ftl/codec/golomb.hpp b/include/ftl/codec/golomb.hpp index 9c93248247e000e3c26943e30585a71f65518ae9..aca308851a68326152c01c491c5702afee771181 100644 --- a/include/ftl/codec/golomb.hpp +++ b/include/ftl/codec/golomb.hpp @@ -84,9 +84,8 @@ static inline int golombSigned(ParseContext *ctx) { buf >>= log; ctx->index += 32 - log; - if(buf & 1) buf = -(buf>>1); - else buf = (buf>>1); - return buf; + if(buf & 1) return -static_cast<int>(buf>>1); + else return buf >> 1; } }