golomb: use HAVE_BITS_REMAINING() macro to prevent infloop on EOF.

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC: libav-stable@libav.org
(cherry picked from commit 46b3fbc30b)

Signed-off-by: Reinhard Tartler <siretart@tauware.de>
This commit is contained in:
Ronald S. Bultje
2012-02-17 12:54:37 -08:00
committed by Reinhard Tartler
parent 25b4ed053f
commit e43bd4fa58

View File

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