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

avcodec/shorten: Fix bitstream end check in read_header()

Fixes: Timeout
Fixes: 9961/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_SHORTEN_fuzzer-5687856176562176

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg


Reviewed-by: default avatarPaul B Mahol <onemda@gmail.com>
Signed-off-by: default avatarMichael Niedermayer <michael@niedermayer.cc>
parent 71bf0330
No related branches found
No related tags found
No related merge requests found
......@@ -456,7 +456,7 @@ static int read_header(ShortenContext *s)
}
skip_bytes = get_uint(s, NSKIPSIZE);
if ((unsigned)skip_bytes > get_bits_left(&s->gb)/8) {
if ((unsigned)skip_bytes > FFMAX(get_bits_left(&s->gb), 0)/8) {
av_log(s->avctx, AV_LOG_ERROR, "invalid skip_bytes: %d\n", skip_bytes);
return AVERROR_INVALIDDATA;
}
......
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