[FFmpeg-cvslog] avcodec/shorten: Sanity check maxnlpc

Michael Niedermayer git at videolan.org
Sun Jun 18 17:36:54 EEST 2017


ffmpeg | branch: release/3.1 | Michael Niedermayer <michael at niedermayer.cc> | Fri Jun  9 02:16:54 2017 +0200| [37c77f74c277631463fe7e82e54bae5efdc48bee] | committer: Michael Niedermayer

avcodec/shorten: Sanity check maxnlpc

Fixes OOM
Fixes: 2131/clusterfuzz-testcase-minimized-4718045157130240

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>
(cherry picked from commit e77ddd31a8e14bcf5eccd6008d866ae90b4b0d4c)
Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=37c77f74c277631463fe7e82e54bae5efdc48bee
---

 libavcodec/shorten.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/libavcodec/shorten.c b/libavcodec/shorten.c
index 388d8dee78..a36a77210e 100644
--- a/libavcodec/shorten.c
+++ b/libavcodec/shorten.c
@@ -436,6 +436,10 @@ static int read_header(ShortenContext *s)
         s->blocksize = blocksize;
 
         maxnlpc  = get_uint(s, LPCQSIZE);
+        if (maxnlpc > 1024U) {
+            av_log(s->avctx, AV_LOG_ERROR, "maxnlpc is: %d\n", maxnlpc);
+            return AVERROR_INVALIDDATA;
+        }
         s->nmean = get_uint(s, 0);
 
         skip_bytes = get_uint(s, NSKIPSIZE);



More information about the ffmpeg-cvslog mailing list