[FFmpeg-cvslog] avcodec/scpr: check for possible out of array access
Paul B Mahol
git at videolan.org
Mon Apr 2 10:25:52 EEST 2018
ffmpeg | branch: master | Paul B Mahol <onemda at gmail.com> | Mon Apr 2 08:59:20 2018 +0200| [22a878ecd1c1d67ea985e998d9c0493795b86427] | committer: Paul B Mahol
avcodec/scpr: check for possible out of array access
Signed-off-by: Paul B Mahol <onemda at gmail.com>
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=22a878ecd1c1d67ea985e998d9c0493795b86427
---
libavcodec/scpr.c | 4 ++++
1 file changed, 4 insertions(+)
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;
More information about the ffmpeg-cvslog
mailing list