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

avcodec/truemotion2: Check len in tm2_read_stream()

Fixes: Timeout
Fixes: 8774/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_TRUEMOTION2_fuzzer-5942199639343104

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
parent 00f98d23
No related branches found
No related tags found
No related merge requests found
......@@ -377,6 +377,10 @@ static int tm2_read_stream(TM2Context *ctx, const uint8_t *buf, int stream_id, i
}
}
} else {
if (len < 0) {
ret = AVERROR_INVALIDDATA;
goto end;
}
for (i = 0; i < toks; i++) {
ctx->tokens[stream_id][i] = codes.recode[0];
if (stream_id <= TM2_MOT && ctx->tokens[stream_id][i] >= TM2_DELTAS) {
......
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