Skip to content
Snippets Groups Projects
Commit e77ddd31 authored by Michael Niedermayer's avatar Michael Niedermayer
Browse files

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: default avatarMichael Niedermayer <michael@niedermayer.cc>
parent 18f09524
No related branches found
No related tags found
No related merge requests found
......@@ -445,6 +445,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);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment