diff options
author | Paul B Mahol <onemda@gmail.com> | 2018-04-02 08:59:20 +0200 |
---|---|---|
committer | Paul B Mahol <onemda@gmail.com> | 2018-04-02 09:02:25 +0200 |
commit | 22a878ecd1c1d67ea985e998d9c0493795b86427 (patch) | |
tree | 9c2a57ce899add8b2ec42c9d5d00c35152623c45 /libavcodec/scpr.c | |
parent | 02ae52db87270715bb81ddb912a2e3968e973d1f (diff) | |
download | ffmpeg-22a878ecd1c1d67ea985e998d9c0493795b86427.tar.gz |
avcodec/scpr: check for possible out of array access
Signed-off-by: Paul B Mahol <onemda@gmail.com>
Diffstat (limited to 'libavcodec/scpr.c')
-rw-r--r-- | libavcodec/scpr.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/libavcodec/scpr.c b/libavcodec/scpr.c index ad6073dbf0..3c797d55f5 100644 --- a/libavcodec/scpr.c +++ b/libavcodec/scpr.c @@ -211,6 +211,10 @@ static int decode_value(SCPRContext *s, unsigned *cnt, unsigned maxc, unsigned s break; c++; } + + if (c >= maxc) + return AVERROR_INVALIDDATA; + if ((ret = s->decode(gb, rc, cumfr, cnt_c, totfr)) < 0) return ret; |