[FFmpeg-cvslog] golomb: Fix infinite loop in svq3_get_ue_golomb()

Michael Niedermayer git at videolan.org
Sun Dec 25 05:02:27 CET 2011


ffmpeg | branch: master | Michael Niedermayer <michaelni at gmx.at> | Sun Dec 25 04:15:56 2011 +0100| [964506bb979e8c972833c7421a39f3275d3cd3c0] | committer: Michael Niedermayer

golomb: Fix infinite loop in svq3_get_ue_golomb()

Signed-off-by: Michael Niedermayer <michaelni at gmx.at>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=964506bb979e8c972833c7421a39f3275d3cd3c0
---

 libavcodec/golomb.h |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/libavcodec/golomb.h b/libavcodec/golomb.h
index 14cf055..638357b 100644
--- a/libavcodec/golomb.h
+++ b/libavcodec/golomb.h
@@ -123,7 +123,7 @@ static inline int svq3_get_ue_golomb(GetBitContext *gb){
     }else{
         int ret = 1;
 
-        while (1) {
+        do {
             buf >>= 32 - 8;
             LAST_SKIP_BITS(re, gb, FFMIN(ff_interleaved_golomb_vlc_len[buf], 8));
 
@@ -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<0x8000000U);
 
         CLOSE_READER(re, gb);
         return ret - 1;



More information about the ffmpeg-cvslog mailing list