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:
authorMichael Niedermayer <michael@niedermayer.cc>2017-06-09 03:16:54 +0300
committerMichael Niedermayer <michael@niedermayer.cc>2017-06-17 03:23:53 +0300
commit12cf6ace44f667da5be32c68408db19482ee994a (patch)
treeda81b84a250ced88ea3d5fb8fd222d0e5c55d46a
parent39d9308b992a4d90349fd1b001f34b15fdb0ab02 (diff)
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@niedermayer.cc> (cherry picked from commit e77ddd31a8e14bcf5eccd6008d866ae90b4b0d4c) Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
-rw-r--r--libavcodec/shorten.c4
1 files changed, 4 insertions, 0 deletions
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);