[FFmpeg-devel] [PATCH 2/3] avcodec/mpeg4video_parser: Fix incorrect spliting of MPEG-4 studio frames

Michael Niedermayer michael at niedermayer.cc
Mon Apr 30 00:56:15 EEST 2018


Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>
---
 libavcodec/mpeg4video_parser.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/libavcodec/mpeg4video_parser.c b/libavcodec/mpeg4video_parser.c
index b7d6da1f75..453d373e6e 100644
--- a/libavcodec/mpeg4video_parser.c
+++ b/libavcodec/mpeg4video_parser.c
@@ -61,6 +61,8 @@ int ff_mpeg4_find_frame_end(ParseContext *pc, const uint8_t *buf, int buf_size)
         for (; i < buf_size; i++) {
             state = (state << 8) | buf[i];
             if ((state & 0xFFFFFF00) == 0x100) {
+                if (state == 0x1B7 || state == 0x1B8)
+                    continue;
                 pc->frame_start_found = 0;
                 pc->state             = -1;
                 return i - 3;
-- 
2.17.0



More information about the ffmpeg-devel mailing list