diff options
author | Michael Niedermayer <[email protected]> | 2017-06-09 02:16:54 +0200 |
---|---|---|
committer | Michael Niedermayer <[email protected]> | 2017-08-23 13:15:18 +0200 |
commit | aa97dafd26849c4413df409e713b358e9d57f6dd (patch) | |
tree | 2b1ee32db0a25b1840f4981e258fdae7f3fd6349 | |
parent | ccc14ccc45ca6d5abe54d049f6178edc3593e7f9 (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 <[email protected]>
(cherry picked from commit e77ddd31a8e14bcf5eccd6008d866ae90b4b0d4c)
Signed-off-by: Michael Niedermayer <[email protected]>
-rw-r--r-- | libavcodec/shorten.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/libavcodec/shorten.c b/libavcodec/shorten.c index b01fdbbca3..e00a7f1ec6 100644 --- a/libavcodec/shorten.c +++ b/libavcodec/shorten.c @@ -369,6 +369,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); |