diff options
author | Michael Niedermayer <michael@niedermayer.cc> | 2017-05-13 23:13:38 +0200 |
---|---|---|
committer | Michael Niedermayer <michael@niedermayer.cc> | 2017-05-14 00:21:50 +0200 |
commit | 6f8dab7a7bd9fdf00b2c1f1e62bd2aa159f40908 (patch) | |
tree | e3d47765f0c16529f027807b5ffce15e03dbfca0 | |
parent | 47da68fc8e244158c858b928b82181271dd28a60 (diff) | |
download | ffmpeg-6f8dab7a7bd9fdf00b2c1f1e62bd2aa159f40908.tar.gz |
avcodec/mlpdec: Check that there is enough data for headers
Fixes: out of array access
Fixes: 1541/clusterfuzz-testcase-minimized-6403410590957568
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 e3e51f8c14d22ae11684dcfe58df355f0f9e6401)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
-rw-r--r-- | libavcodec/mlpdec.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/libavcodec/mlpdec.c b/libavcodec/mlpdec.c index b471f0d760..fa4347fb23 100644 --- a/libavcodec/mlpdec.c +++ b/libavcodec/mlpdec.c @@ -1162,6 +1162,11 @@ static int read_access_unit(AVCodecContext *avctx, void* data, substr_header_size += 2; } + if (length < header_size + substr_header_size) { + av_log(m->avctx, AV_LOG_ERROR, "Insuffient data for headers\n"); + goto error; + } + if (!(nonrestart_substr ^ m->is_major_sync_unit)) { av_log(m->avctx, AV_LOG_ERROR, "Invalid nonrestart_substr.\n"); goto error; |