Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/FFmpeg/FFmpeg.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2017-05-28 22:54:02 +0300
committerMichael Niedermayer <michael@niedermayer.cc>2017-06-16 02:05:28 +0300
commitba925988efe75adfcc33f9235e6b1ccda7bf994b (patch)
tree31be592bb42eb6e923ec082ed56ac11b1dde0b13
parent362a98eea9b85324a733e653dbe06bea124014a9 (diff)
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>
-rw-r--r--libavcodec/truemotion2.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/libavcodec/truemotion2.c b/libavcodec/truemotion2.c
index 4f0e52dbf7..e6ae05f1d5 100644
--- a/libavcodec/truemotion2.c
+++ b/libavcodec/truemotion2.c
@@ -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;