diff --git a/libavcodec/golomb.h b/libavcodec/golomb.h index 5f720c03f3..1712540fd3 100644 --- a/libavcodec/golomb.h +++ b/libavcodec/golomb.h @@ -135,7 +135,7 @@ static inline int svq3_get_ue_golomb(GetBitContext *gb){ ret = (ret << 4) | ff_interleaved_dirac_golomb_vlc_code[buf]; UPDATE_CACHE(re, gb); buf = GET_CACHE(re, gb); - } while (ret); + } while (HAVE_BITS_REMAINING(re, gb)); CLOSE_READER(re, gb); return ret - 1;