X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=libavcodec%2Fmpeg4video_parser.c;h=9ebb09a63e7ad17eb1c63686561a5d2b0a1dc111;hb=4cfb01d6ae545cec4a507113a6cbcf3b6e727e94;hp=b7d6da1f75257ff007243b5cec710ace73ba6ff2;hpb=44df2e858889ab8e41d6a9f403433d7adc304bbe;p=ffmpeg diff --git a/libavcodec/mpeg4video_parser.c b/libavcodec/mpeg4video_parser.c index b7d6da1f752..9ebb09a63e7 100644 --- a/libavcodec/mpeg4video_parser.c +++ b/libavcodec/mpeg4video_parser.c @@ -46,7 +46,7 @@ int ff_mpeg4_find_frame_end(ParseContext *pc, const uint8_t *buf, int buf_size) if (!vop_found) { for (i = 0; i < buf_size; i++) { state = (state << 8) | buf[i]; - if (state == 0x1B6) { + if (state == VOP_STARTCODE) { i++; vop_found = 1; break; @@ -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 == SLICE_STARTCODE || state == EXT_STARTCODE) + continue; pc->frame_start_found = 0; pc->state = -1; return i - 3;