[FFmpeg-cvslog] indeo3: Check remaining bits in parse_bintree()

Michael Niedermayer git at videolan.org
Fri Nov 25 18:13:19 CET 2011


ffmpeg | branch: master | Michael Niedermayer <michaelni at gmx.at> | Fri Nov 25 17:47:17 2011 +0100| [e9e642cbfbf36285f60d1dba00103f068b077940] | committer: Michael Niedermayer

indeo3: Check remaining bits in parse_bintree()

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

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

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

diff --git a/libavcodec/indeo3.c b/libavcodec/indeo3.c
index 22984db..b20c3fc 100644
--- a/libavcodec/indeo3.c
+++ b/libavcodec/indeo3.c
@@ -736,7 +736,7 @@ static int parse_bintree(Indeo3DecodeContext *ctx, AVCodecContext *avctx,
         ref_cell->width -= curr_cell.width;
     }
 
-    while (1) { /* loop until return */
+    while (get_bits_left(&ctx->gb) >= 2) { /* loop until return */
         RESYNC_BITSTREAM;
         switch (code = get_bits(&ctx->gb, 2)) {
         case H_SPLIT:
@@ -789,7 +789,7 @@ static int parse_bintree(Indeo3DecodeContext *ctx, AVCodecContext *avctx,
         }
     }//while
 
-    return 0;
+    return AVERROR_INVALIDDATA;
 }
 
 



More information about the ffmpeg-cvslog mailing list