[FFmpeg-cvslog] avcodec/cavsdec: Check esc_code

Michael Niedermayer git at videolan.org
Tue Jun 2 00:50:12 CEST 2015


ffmpeg | branch: release/2.4 | Michael Niedermayer <michaelni at gmx.at> | Thu May 14 17:54:40 2015 +0200| [62e4fe09ed0bece519e845df11e380ead0d6a295] | 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=62e4fe09ed0bece519e845df11e380ead0d6a295
---

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

diff --git a/libavcodec/cavsdec.c b/libavcodec/cavsdec.c
index f2ff10b..a05e5c5 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