1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2025-02-20 07:48:15 +02:00

avcodec/truemotion2: Fix passing null pointer to memset()

Fixes part of: 1888/clusterfuzz-testcase-minimized-5237704826552320

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 c901627918ff7480c1bb6f9cae507ee2c7c933d8)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
This commit is contained in:
Michael Niedermayer 2017-05-28 21:54:02 +02:00
parent e561676c55
commit 79f75b123b

View File

@ -915,7 +915,8 @@ static int decode_frame(AVCodecContext *avctx,
buf_size - offset);
if (t < 0) {
int j = tm2_stream_order[i];
memset(l->tokens[j], 0, sizeof(**l->tokens) * l->tok_lens[j]);
if (l->tok_lens[j])
memset(l->tokens[j], 0, sizeof(**l->tokens) * l->tok_lens[j]);
return t;
}
offset += t;