From patchwork Wed Jun 27 18:11:17 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Michael Niedermayer X-Patchwork-Id: 9525 Delivered-To: ffmpegpatchwork@gmail.com Received: by 2002:a02:104:0:0:0:0:0 with SMTP id c4-v6csp1153178jad; Wed, 27 Jun 2018 11:12:53 -0700 (PDT) X-Google-Smtp-Source: AAOMgpcw+RLuDnwY0zNHb8ZcaKzekfsDIPog8UHVC8bVi5d22LuS0lqluXiX5UXG91hmT3rAvHua X-Received: by 2002:adf:86ea:: with SMTP id 39-v6mr315683wry.232.1530123173550; Wed, 27 Jun 2018 11:12:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1530123173; cv=none; d=google.com; s=arc-20160816; b=XQ+HUZGMMANW+z4jA2UGk2bEdCTXAbGUMrb5ShiJtTwGom0f3Ob05vlIwuzhP3F/5V cjNd0565evxWTIRFOEz2Rc4ZZVOScRO9VadhalfX9XwWf8jJ65jKC8wk5zzANrc+AW5c FCa0resp6vuZSsw0cLYKY9drCA2P3taMnNZONXHPAQ/3XV9avJfVMps3UI60d6hFZtqS RZnznI6lsUVfLuNjuX7JiAaWB0rGmiTEFHEoiVcd3dHjyvxK+GfSy1O9wCQGDY2D9yP2 wXJGlylIJsR9w4RmoEUPxPWq7jlt7E+13V0ZM+1gZJPxIBiPHRH7/UWnxg4p7irnX1Wl Urow== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:reply-to:list-subscribe :list-help:list-post:list-archive:list-unsubscribe:list-id :precedence:subject:mime-version:references:in-reply-to:message-id :date:to:from:delivered-to:arc-authentication-results; bh=cUmJaIzwd8zQ9QOvSgqGAujIk4vGm9Vk1HUC3WSewnA=; b=eJCW4OZ5GljbkXzJ5/jLgzyBQX/kYyBKG0Zq21C7F5HyKewQ+rWoLyJnMRjxWIpOxw iof7FgWCzMZcrpJtSccDm6MlqXgUIgze9HDGJwYZcVDk7iJI0L2AKpVq9AAYuhIH2Pwh 7MQfxo54hWeaauqshbcQZmsQi+6etfv4IFseVEtKmR6/ctwLdEraCrdM3Un8O8oCcTeE FTR06kvVBDuXjN1PPVvLC5j+9DOWj1FcRpJVAhZ6TqE+7OMm85XRrZyM07jS++7TV7ak mUhrTg/VaO94uOzhsOYgPW95LrAXbzQmHcxCncw4oTRLLbqaKwQstV2lt6RXclpJmIc+ vw7A== 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 n4-v6si2135716wrp.237.2018.06.27.11.12.53; Wed, 27 Jun 2018 11:12:53 -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 9B34A68A4B7; Wed, 27 Jun 2018 21:12:23 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from vie01a-dmta-pe05-1.mx.upcmail.net (vie01a-dmta-pe05-1.mx.upcmail.net [84.116.36.11]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id B1DB168A41E for ; Wed, 27 Jun 2018 21:12:15 +0300 (EEST) Received: from [172.31.216.43] (helo=vie01a-pemc-psmtp-pe01) by vie01a-dmta-pe05.mx.upcmail.net with esmtp (Exim 4.88) (envelope-from ) id 1fYEvQ-000522-O3 for ffmpeg-devel@ffmpeg.org; Wed, 27 Jun 2018 20:12:16 +0200 Received: from localhost ([213.47.41.20]) by vie01a-pemc-psmtp-pe01 with SMTP @ mailcloud.upcmail.net id 3uC81y01b0S5wYM01uC9qF; Wed, 27 Jun 2018 20:12:09 +0200 X-SourceIP: 213.47.41.20 From: Michael Niedermayer To: FFmpeg development discussions and patches Date: Wed, 27 Jun 2018 20:11:17 +0200 Message-Id: <20180627181121.30735-4-michael@niedermayer.cc> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20180627181121.30735-1-michael@niedermayer.cc> References: <20180627181121.30735-1-michael@niedermayer.cc> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH 4/8] avformat/movenc: Check that frame_types other than EAC3_FRAME_TYPE_INDEPENDENT have a supported substream id 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 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Fixes: out of array access Fixes: ffmpeg_bof_1.avi Found-by: Thuan Pham, Marcel Böhme, Andrew Santosa and Alexandru Razvan Caciulescu with AFLSmart Signed-off-by: Michael Niedermayer --- libavformat/movenc.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/libavformat/movenc.c b/libavformat/movenc.c index e2c5613f98..00567db586 100644 --- a/libavformat/movenc.c +++ b/libavformat/movenc.c @@ -437,6 +437,12 @@ static int handle_eac3(MOVMuxContext *mov, AVPacket *pkt, MOVTrack *track) info->ec3_done = 1; goto concatenate; } + } else { + if (hdr->substreamid != 0) { + avpriv_request_sample(track->par, "Multiple dependent substreams"); + ret = AVERROR_PATCHWELCOME; + goto end; + } } /* fill the info needed for the "dec3" atom */