aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2017-05-20 01:23:01 +0200
committerMichael Niedermayer <michael@niedermayer.cc>2017-05-20 02:42:44 +0200
commitf6fbc874d1e34cc2f7a028478d47c45547eb6d4c (patch)
treea8b1d1f20551a29da1f226b6e97f7f167e9eb51a
parent9532ad523ec5b8164ce377bfebf92776d5da898b (diff)
downloadffmpeg-f6fbc874d1e34cc2f7a028478d47c45547eb6d4c.tar.gz
avcodec/mlpdec: Do not leave a invalid num_primitive_matrices in the context
Fixes: runtime error: index 8 out of bounds for type 'uint8_t [8]' Fixes: 1699/clusterfuzz-testcase-minimized-6327177438035968 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/targets/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc> (cherry picked from commit 64ea4d102a070b95832ae4a751688f87da7760a2) Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
-rw-r--r--libavcodec/mlpdec.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/libavcodec/mlpdec.c b/libavcodec/mlpdec.c
index 5426712007..eac19a0d5e 100644
--- a/libavcodec/mlpdec.c
+++ b/libavcodec/mlpdec.c
@@ -729,6 +729,7 @@ static int read_matrix_params(MLPDecodeContext *m, unsigned int substr, GetBitCo
av_log(m->avctx, AV_LOG_ERROR,
"Number of primitive matrices cannot be greater than %d.\n",
max_primitive_matrices);
+ s->num_primitive_matrices = 0;
return AVERROR_INVALIDDATA;
}