[FFmpeg-cvslog] avcodec/cavsdec: Check esc_code

Michael Niedermayer git at videolan.org
Wed Jun 17 22:09:42 CEST 2015


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

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

diff --git a/libavcodec/cavsdec.c b/libavcodec/cavsdec.c
index 399b5b9..9be38fc 100644
--- a/libavcodec/cavsdec.c
+++ b/libavcodec/cavsdec.c
@@ -570,6 +570,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