[FFmpeg-cvslog] tta: check remaining bitstream size while reading unary value

Justin Ruggles git at videolan.org
Wed Oct 26 02:46:27 CEST 2011


ffmpeg | branch: master | Justin Ruggles <justin.ruggles at gmail.com> | Wed Sep 21 14:16:24 2011 -0400| [35f9d8c20a26a7d383d3d36796e64a4b8987d743] | committer: Justin Ruggles

tta: check remaining bitstream size while reading unary value

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

 libavcodec/tta.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/libavcodec/tta.c b/libavcodec/tta.c
index 5a11436..9330e2d 100644
--- a/libavcodec/tta.c
+++ b/libavcodec/tta.c
@@ -182,7 +182,7 @@ static int tta_get_unary(GetBitContext *gb)
     int ret = 0;
 
     // count ones
-    while(get_bits1(gb))
+    while (get_bits_left(gb) > 0 && get_bits1(gb))
         ret++;
     return ret;
 }



More information about the ffmpeg-cvslog mailing list