[FFmpeg-cvslog] avcodec/mlp_parser: Check if synccode is within buffer

Michael Niedermayer git at videolan.org
Fri Aug 3 03:11:25 EEST 2018


ffmpeg | branch: master | Michael Niedermayer <michael at niedermayer.cc> | Sun Jul 29 13:16:37 2018 +0200| [51ac3f43b8bf3b7f2af555af319cd240bb8b4ebf] | committer: Michael Niedermayer

avcodec/mlp_parser: Check if synccode is within buffer

Fixes: undefined shift
Fixes: 9216/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_TRUEHD_fuzzer-6281404575907840

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=51ac3f43b8bf3b7f2af555af319cd240bb8b4ebf
---

 libavcodec/mlp_parser.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavcodec/mlp_parser.c b/libavcodec/mlp_parser.c
index 185bd4d667..eb3435b6cb 100644
--- a/libavcodec/mlp_parser.c
+++ b/libavcodec/mlp_parser.c
@@ -320,7 +320,7 @@ static int mlp_parse(AVCodecParserContext *s,
         mp->bytes_left = 0;
     }
 
-    sync_present = (AV_RB32(buf + 4) & 0xfffffffe) == 0xf8726fba;
+    sync_present = buf_size >= 8 && (AV_RB32(buf + 4) & 0xfffffffe) == 0xf8726fba;
 
     if (!sync_present) {
         /* The first nibble of a frame is a parity check of the 4-byte



More information about the ffmpeg-cvslog mailing list