From patchwork Mon Aug 20 17:56:04 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jacob Trimble X-Patchwork-Id: 10036 Delivered-To: ffmpegpatchwork@gmail.com Received: by 2002:a02:12c4:0:0:0:0:0 with SMTP id 65-v6csp2793508jap; Mon, 20 Aug 2018 11:02:29 -0700 (PDT) X-Google-Smtp-Source: AA+uWPztt3gEv2GpQpSO+2LTFAFD8He92Zw6e6/3vkI4n45O3tMIrzwtcVtbtPf4kmhbwcbXFr/n X-Received: by 2002:a1c:a989:: with SMTP id s131-v6mr28761552wme.136.1534788149898; Mon, 20 Aug 2018 11:02:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1534788149; cv=none; d=google.com; s=arc-20160816; b=AzndE5SnkxCp4E2IcscueNvHLmjDkNMxqPYmhjCtG7WZ9BAJA9yaIP1qnWCGz6CnTW pwMLmpm9xvZZdFc9D7M4Y16BYkXAZjsnMQ8c1Ivg4PMlGrNSU/fbqqhYcuvrPZO0x6Iw 0MoVGpnL3QR3I7VVXSsMrgwIKqVB9bfq/1/NyzUUqNb0sP7nyo29SHL22ni4/iuzrAkl yIE6vC38XSBOmcKdS7FwfnU9N1FKAA0wR2vtdid7o25IJJmI93bgm5SaOkL3Sejj9J4O harry1J1L8Z1j/t1nRMucwW7R4ykvq7OxCSgSHi5N6BqNb6BxJx3ZhQ20u0NFJGFcSd0 71HA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:reply-to:list-subscribe:list-help:list-post :list-archive:list-unsubscribe:list-id:precedence:subject:to :message-id:date:from:in-reply-to:references:mime-version :dkim-signature:delivered-to:arc-authentication-results; bh=qRpJbbGO76jAP70LTupF1XFNHbg1fLDDR6nyuMM4rjE=; b=eZ20CevMGeEjVLGtETzesN+mhkpnGaqUCkZXmXYELiOHcjsQz5wfQ7T5ot+JeUYEbn H5k0GLz1lFrBC5+Br9nzg2Cj0QauIp+EyaGT78gJI/QAZdayvoLeFP4Vs5nIJKq9W4Pz wlQU3FeJZL0xGdN4XmZoQGF3CDUXpy1Nq6c8j0MhjCY0aIXJ6biQg+ouvN5n0w7bJhLx ZeQv9rFPfgrFeWV2JPMxx+xv0ar8faa+qHGJ/9GI3sTZmBp2QL0mj9TjDqqEvQUmzFFf /JZ8B/qps7rlKWJ9/rg1t6GHwg8xP6Le0lZ/cTb/0XmKuLNU4tpA1uf9WN3cNLOKXQMS 3i8g== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@google.com header.s=20161025 header.b=PdIj0Irl; 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 y10-v6si209255wmb.111.2018.08.20.11.02.29; Mon, 20 Aug 2018 11:02:29 -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; dkim=neutral (body hash did not verify) header.i=@google.com header.s=20161025 header.b=PdIj0Irl; 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 F03DC689BDC; Mon, 20 Aug 2018 21:02:00 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-lf1-f53.google.com (mail-lf1-f53.google.com [209.85.167.53]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id D740D689914 for ; Mon, 20 Aug 2018 21:01:54 +0300 (EEST) Received: by mail-lf1-f53.google.com with SMTP id g9-v6so6330400lfh.1 for ; Mon, 20 Aug 2018 11:02:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to; bh=cK5EacveR5ZpvxpV3+/eAfHrufWgO2dt7sqCsjp2znE=; b=PdIj0IrlGyPCgHB6PJtu1eFWF6dQ6O6W/1fEBUMDh0URcVWylxVCU3JB5hGLMmX0+c VgxdP50prldezyxw69fUXc00VWEu40yKQehhklN1N3kwP5v0Qdy44BtcYUtB6/VdNsFg rV4xqUmJRDlsZ/GGA/Il662KIGNcu5mBD70Jdob5DwDlnnvPrNGRCnRlkGAPDRat2svd 37NenEktznIRx2AtjK/cYXYTsIeiViZ4Gfpfw0SBjVPGbnPYXesdFkspIFBCx3rrTJps gqYPtg8SPe1z3rs9Q9F9g2MjS+rmm21oOOxoSLI9Up7wc9CrP2NrE53bebG6CU8xWuZ8 gXrA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to; bh=cK5EacveR5ZpvxpV3+/eAfHrufWgO2dt7sqCsjp2znE=; b=bFBB2ZvIW6efsGeltJ5U5J8M2DbsTYjI6PdQo78qw6WTJiV44uQKSmrGUHuvP8YxPz iydRYAsw+bdJqNj1lov80gSMm9185VRXtp4ryZqc30PhPf8NzhISZ/tzoXIC92FsBK4i sHp+GjpWi/wToKdt58o0LtPq5PH3K005S8rEqJxMqNGkWv1RqVYE0Rsw8YNsEHi4AMgD EQZpfDnkEATTO5gCqKDGgVWm4QXOS+ZKiOUZGvlODkoRAaQ/YYZg6Y+o5EKW8YTIU8/g IY3PbVG9zK74vGR5gm/XkFDr9jTJnErbWcDAQm+vnGrRoxAzWlCVqezx3CckgFfTEyT5 OUOw== X-Gm-Message-State: AOUpUlEDv4jaOBMcPhqrrulGRnAZIlJC+dVxITto48qHebrtaz9nXnSc HFVy1VzmCThvRMN+GDc8ePjlTONEuIAQx8DlVCNS/8TK X-Received: by 2002:a19:548e:: with SMTP id b14-v6mr28976979lfl.10.1534787776451; Mon, 20 Aug 2018 10:56:16 -0700 (PDT) MIME-Version: 1.0 References: <20180814173903.12962-1-modmaker@google.com> <20180815213800.GS19650@michaelspb> In-Reply-To: <20180815213800.GS19650@michaelspb> From: Jacob Trimble Date: Mon, 20 Aug 2018 10:56:04 -0700 Message-ID: To: FFmpeg development discussions and patches Subject: Re: [FFmpeg-devel] [PATCH] avformat/mov: Allow saio/saiz in clear content. 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" On Wed, Aug 15, 2018 at 2:38 PM Michael Niedermayer wrote: > > [...] > > > mov.c | 6 ++++++ > > 1 file changed, 6 insertions(+) > > 0e583b4ad11852ce38a2b945644e178b7f13a42f 0001-avformat-mov-Allow-saio-saiz-in-clear-content-v2.patch > > From 256880aca517f64257eb28342a656867d90307a7 Mon Sep 17 00:00:00 2001 > > From: Jacob Trimble > > Date: Tue, 14 Aug 2018 10:18:55 -0700 > > Subject: [PATCH] avformat/mov: Allow saio/saiz in clear content. > > This code is used in saio/saiz/senc. The message only mentions the first > 2. > senc shouldn't appear in clear content, so it shouldn't change anything. Changed the commit message to include that. > > [...] > > -- > Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB > > Whats the most studid thing your enemy could do ? Blow himself up > Whats the most studid thing you could do ? Give up your rights and > freedom because your enemy blew himself up. > > _______________________________________________ > ffmpeg-devel mailing list > ffmpeg-devel@ffmpeg.org > http://ffmpeg.org/mailman/listinfo/ffmpeg-devel From 18e6aba25364b988ac52413949f62eef03d6c648 Mon Sep 17 00:00:00 2001 From: Jacob Trimble Date: Tue, 14 Aug 2018 10:18:55 -0700 Subject: [PATCH] avformat/mov: Allow saio/saiz in clear content. If there is a saio/saiz in clear content, we shouldn't create the encryption index if we don't already have one. Otherwise it will confuse the cenc_filter. The changed method is also used for senc atoms, but they should not appear in clear content. Found by Chromium's ClusterFuzz: https://crbug.com/873432 Signed-off-by: Jacob Trimble --- libavformat/mov.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/libavformat/mov.c b/libavformat/mov.c index c863047d79..ee9acdb73c 100644 --- a/libavformat/mov.c +++ b/libavformat/mov.c @@ -5847,6 +5847,9 @@ static int get_current_encryption_info(MOVContext *c, MOVEncryptionIndex **encry *sc = st->priv_data; if (!frag_stream_info->encryption_index) { + // If this stream isn't encrypted, don't create the index. + if (!(*sc)->cenc.default_encrypted_sample) + return 0; frag_stream_info->encryption_index = av_mallocz(sizeof(*frag_stream_info->encryption_index)); if (!frag_stream_info->encryption_index) return AVERROR(ENOMEM); @@ -5862,6 +5865,9 @@ static int get_current_encryption_info(MOVContext *c, MOVEncryptionIndex **encry *sc = st->priv_data; if (!(*sc)->cenc.encryption_index) { + // If this stream isn't encrypted, don't create the index. + if (!(*sc)->cenc.default_encrypted_sample) + return 0; (*sc)->cenc.encryption_index = av_mallocz(sizeof(*frag_stream_info->encryption_index)); if (!(*sc)->cenc.encryption_index) return AVERROR(ENOMEM); -- 2.18.0.865.gffc8e1a3cd6-goog