[FFmpeg-cvslog] avcodec/cavsdec: Check esc_code

Michael Niedermayer git at videolan.org
Thu May 21 21:26:06 CEST 2015


ffmpeg | branch: release/2.5 | Michael Niedermayer <michaelni at gmx.at> | Thu May 14 17:54:40 2015 +0200| [ebdbb13108687804c6e58eacc94d621cf370b010] | committer: Michael Niedermayer

avcodec/cavsdec: Check esc_code

Signed-off-by: Michael Niedermayer <michaelni at gmx.at>
(cherry picked from commit 139e1c8009df7729a53eaaae7036ca01071aced5)

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

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

 libavcodec/cavsdec.c |    5 +++++
 1 file changed, 5 insertions(+)

diff --git a/libavcodec/cavsdec.c b/libavcodec/cavsdec.c
index b5304ea..034c5d6 100644
--- a/libavcodec/cavsdec.c
+++ b/libavcodec/cavsdec.c
@@ -563,6 +563,11 @@ static int decode_residual_block(AVSContext *h, GetBitContext *gb,
                 return AVERROR_INVALIDDATA;
             }
             esc_code = get_ue_code(gb, esc_golomb_order);
+            if (esc_code < 0 || esc_code > 32767) {
+                av_log(h->avctx, AV_LOG_ERROR, "esc_code invalid\n");
+                return AVERROR_INVALIDDATA;
+            }
+
             level    = esc_code + (run > r->max_run ? 1 : r->level_add[run]);
             while (level > r->inc_limit)
                 r++;



More information about the ffmpeg-cvslog mailing list