Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/FFmpeg/FFmpeg.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul B Mahol <onemda@gmail.com>2018-04-02 09:59:20 +0300
committerPaul B Mahol <onemda@gmail.com>2018-04-02 10:02:25 +0300
commit22a878ecd1c1d67ea985e998d9c0493795b86427 (patch)
tree9c2a57ce899add8b2ec42c9d5d00c35152623c45 /libavcodec/scpr.c
parent02ae52db87270715bb81ddb912a2e3968e973d1f (diff)
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.c4
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;