[FFmpeg-cvslog] cavsdec: check run value validity

Michael Niedermayer git at videolan.org
Thu Aug 11 20:19:29 CEST 2011


ffmpeg | branch: master | Michael Niedermayer <michaelni at gmx.at> | Thu Aug 11 19:55:44 2011 +0200| [961a1a81d88a05afabb895f8a9dd11e789a07d89] | committer: Michael Niedermayer

cavsdec: check run value validity

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

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

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

diff --git a/libavcodec/cavsdec.c b/libavcodec/cavsdec.c
index 7beedb8..fcfe06e 100644
--- a/libavcodec/cavsdec.c
+++ b/libavcodec/cavsdec.c
@@ -125,6 +125,8 @@ static int decode_residual_block(AVSContext *h, GetBitContext *gb,
         level_code = get_ue_code(gb,r->golomb_order);
         if(level_code >= ESCAPE_CODE) {
             run = ((level_code - ESCAPE_CODE) >> 1) + 1;
+            if(run > 64)
+                return -1;
             esc_code = get_ue_code(gb,esc_golomb_order);
             level = esc_code + (run > r->max_run ? 1 : r->level_add[run]);
             while(level > r->inc_limit)



More information about the ffmpeg-cvslog mailing list