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

avcodec/shorten: Sanity check nmeans

Fixes: OOM
Fixes: 8195/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_SHORTEN_fuzzer-5179785826271232

The reference software appears to use longs for 32bits and it uses int for nmeans
hinting that the intended maximum size was not 32bit.

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 3769aafb
No related branches found
No related tags found
No related merge requests found
......@@ -450,6 +450,10 @@ static int read_header(ShortenContext *s)
return AVERROR_INVALIDDATA;
}
s->nmean = get_uint(s, 0);
if (s->nmean > 32768U) {
av_log(s->avctx, AV_LOG_ERROR, "nmean is: %d\n", s->nmean);
return AVERROR_INVALIDDATA;
}
skip_bytes = get_uint(s, NSKIPSIZE);
if ((unsigned)skip_bytes > get_bits_left(&s->gb)/8) {
......
  • Auri @aurieh

    mentioned in commit 3aa3b05d

    ·

    mentioned in commit 3aa3b05d

    Toggle commit list
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