mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2024-12-23 12:43:46 +02:00
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 e77ddd31a8
)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
This commit is contained in:
parent
1729101c44
commit
01ed8d93b2
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user