From patchwork Sun Apr 29 21:56:15 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Niedermayer X-Patchwork-Id: 8696 Delivered-To: ffmpegpatchwork@gmail.com Received: by 2002:a02:155:0:0:0:0:0 with SMTP id c82-v6csp2898180jad; Sun, 29 Apr 2018 14:57:55 -0700 (PDT) X-Google-Smtp-Source: AB8JxZpDR26Acmr9i/y/3/dMzsf0nDXuybf93OpSwx6z+AeZEXDCB0sSCiUOhvFMfeUf3KuVYpNd X-Received: by 2002:adf:c78d:: with SMTP id l13-v6mr2316282wrg.104.1525039075692; Sun, 29 Apr 2018 14:57:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1525039075; cv=none; d=google.com; s=arc-20160816; b=vmSVmrwGfJZLUp4lFS9viMS4Y1DqLxwI+mvUYQBOs07ttukJ+dzlUXNpUzae0WjZI1 9onQV4tY/fy/pviu0UeLk7C/KdJYqpVFamsNItZaVZhbR4r28g68yeVeZhEoCZ/LrAIm I6wJEptnzU8/qyb0ow/fx4cWkqXJ3Zh2QLCBCSlzjrMr62GEXPaaKMznaSWV5Y4I+i8u GR4OAOHIaaFU3wGadDmXbJ5VwWebj8IdwomwdNBjr4hjfqUXg/HwSNKgv3mF/8Ps/eEI gx8mZUpRT47IqKx8CGM2OkOojZpHNQGOmI+gv+InytqteFflvukspNt1S0A3l1Do/rpo 14LQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:mime-version:reply-to :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:subject:references:in-reply-to:message-id:date :to:from:delivered-to:arc-authentication-results; bh=+jGwX/YLoKFPzD/8Kf2rSHW9DXUeHR0kv4bupXxYD3k=; b=Iv+O3JNQnLWhRBTOR5DsmbPm8nBf7eLc1ZZppTed9ABIYDxnuGW0BTh6myaTtdGVuM eidsqLYOzKcRN1Ho5IrPcIU4CuhrxUwAjXy9T/v/cIqH7alUmfsTtV3E7gDWb3cOHxlA 7ny1dYvYQMaSGzKe2C60aOiUiquAqVlms/o/OHNM7ee0Y/fh0aAX6LWYdXwEtgY9fsEe /s+2xC4oXwsBWsXGBd/t+yKiB3FUpBAe5vGZ3GgGBKt7+dioDg9JOgtGGu2Hl2tgZjH7 U7aKEf36x1gFDnYoxZ6B3RuP0YcTTH3PF6Gx6U/omvYp9riqCJQXgDGI7mBgovwAg5qR Y9zA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) smtp.mailfrom=ffmpeg-devel-bounces@ffmpeg.org Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id h33-v6si3645782wrh.242.2018.04.29.14.57.55; Sun, 29 Apr 2018 14:57:55 -0700 (PDT) Received-SPF: pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) client-ip=79.124.17.100; Authentication-Results: mx.google.com; spf=pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) smtp.mailfrom=ffmpeg-devel-bounces@ffmpeg.org Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 273A968A5BE; Mon, 30 Apr 2018 00:57:08 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from vie01a-dmta-pe02-1.mx.upcmail.net (vie01a-dmta-pe02-1.mx.upcmail.net [62.179.121.157]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 73834689F18 for ; Mon, 30 Apr 2018 00:57:01 +0300 (EEST) Received: from [172.31.216.43] (helo=vie01a-pemc-psmtp-pe01) by vie01a-dmta-pe02.mx.upcmail.net with esmtp (Exim 4.88) (envelope-from ) id 1fCuK5-0001t7-8b for ffmpeg-devel@ffmpeg.org; Sun, 29 Apr 2018 23:57:33 +0200 Received: from localhost ([213.47.41.20]) by vie01a-pemc-psmtp-pe01 with SMTP @ mailcloud.upcmail.net id gMxT1x00E0S5wYM01MxUJd; Sun, 29 Apr 2018 23:57:28 +0200 X-SourceIP: 213.47.41.20 From: Michael Niedermayer To: FFmpeg development discussions and patches Date: Sun, 29 Apr 2018 23:56:15 +0200 Message-Id: <20180429215616.17303-2-michael@niedermayer.cc> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180429215616.17303-1-michael@niedermayer.cc> References: <20180429215616.17303-1-michael@niedermayer.cc> Subject: [FFmpeg-devel] [PATCH 2/3] avcodec/mpeg4video_parser: Fix incorrect spliting of MPEG-4 studio frames X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: FFmpeg development discussions and patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: FFmpeg development discussions and patches MIME-Version: 1.0 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Signed-off-by: Michael Niedermayer --- 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;