From patchwork Mon Nov 29 00:59:28 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marton Balint X-Patchwork-Id: 31789 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a6b:d206:0:0:0:0:0 with SMTP id q6csp5463471iob; Sun, 28 Nov 2021 17:00:02 -0800 (PST) X-Google-Smtp-Source: ABdhPJzIN/nd8jWQzWnto9pi28tgTYsvHDgjOdXsAfwgKFAfC8bjkTaPwhx/YqjKe7V5EvU0WPhi X-Received: by 2002:a05:6402:34d6:: with SMTP id w22mr71373661edc.35.1638147602322; Sun, 28 Nov 2021 17:00:02 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1638147602; cv=none; d=google.com; s=arc-20160816; b=MEmCJR4GIf2pOvfkShQrDcm3pH0+h3e3Qp+//H94kK4bVNDZ9yYN2oacXlcr9lrQXk XJaXOPVZA0RwXUiri7NU5AZ6KZe3dLtPjc5M18ab8ojoREdszG1ZLBcmxT8CkvycdqAJ s7l2jG526ehP8LvzLBt9H4rPjPYwySxnBSh7Njy+EwJOckoFUPIYlfF5NnnwAuz8bGFo jo+nHfKgYLvPi+uLN0in7ZQsWY9aOVQwfs7GDtJjmDmQgQWtotFaeh7G2s0ohQutDcoF MkNkewPnuzpnpgcrecYqVz6NCn1YfWk4t7j67Tyyp6oLhvaJsqH4UMHKLbjgje+Nc2l1 C2ZA== 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; bh=kukJpARd12Vu4QLmjxjH/7MkT8IYIY0HDLxJCjM0Tbc=; b=MRITNoNb5FyIniWXrKxZgcw5A2AQ++UNyJRkJxz+OCEXXXp9go42q3VYToncDdbccS aQZHGjP6ExvU9JViiKU/df4GwIfk1/fVh46YqX0BKXiQQ7v2Zh15dkmJkIuPq1U15beb VDSdafYIRzFw9r8bbckiu8SdKvhRR+A3mDWACQjT4RE5lN54OoFGgXdW91X4Cm2Bc+NK AViXPmm5asG7G/SSsdlLYJ3uuGtt5bQhFo3BmNp5Cj1iBvV8dmJfd8T4WpD4zy9mofNu POPvgw+/R/CK1jRjWcQWetNM2cu20N1bmylydvoz4xsY3PS60S7zwPc4KTPJpcC98pia +Qfw== 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 l10si16992199ejz.697.2021.11.28.17.00.02; Sun, 28 Nov 2021 17:00:02 -0800 (PST) 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 DCBEB68ADE7; Mon, 29 Nov 2021 02:59:43 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from iq.passwd.hu (iq.passwd.hu [217.27.212.140]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 18FF868AD8B for ; Mon, 29 Nov 2021 02:59:35 +0200 (EET) Received: from localhost (localhost [127.0.0.1]) by iq.passwd.hu (Postfix) with ESMTP id 7DD6AE6428 for ; Mon, 29 Nov 2021 01:59:34 +0100 (CET) X-Virus-Scanned: amavisd-new at passwd.hu Received: from iq.passwd.hu ([127.0.0.1]) by localhost (iq.passwd.hu [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id Pg-Yb0uMB9zN for ; Mon, 29 Nov 2021 01:59:32 +0100 (CET) Received: from bluegene.passwd.hu (localhost [127.0.0.1]) by iq.passwd.hu (Postfix) with ESMTP id 14819E6421 for ; Mon, 29 Nov 2021 01:59:31 +0100 (CET) From: Marton Balint To: ffmpeg-devel@ffmpeg.org Date: Mon, 29 Nov 2021 01:59:28 +0100 Message-Id: <20211129005930.7188-3-cus@passwd.hu> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20211129005930.7188-1-cus@passwd.hu> References: <1b5e45c8-574a-c0d3-cf2-11963ad25cc1@passwd.hu> <20211129005930.7188-1-cus@passwd.hu> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH 3/5] avformat/mxfdec: also check for non-positive number of channels X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.29 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" X-TUID: DiPeYJEcrK8u Signed-off-by: Marton Balint --- libavformat/mxfdec.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libavformat/mxfdec.c b/libavformat/mxfdec.c index 8cb66b73c4..e0a52e3883 100644 --- a/libavformat/mxfdec.c +++ b/libavformat/mxfdec.c @@ -2843,8 +2843,8 @@ static int mxf_parse_structural_metadata(MXFContext *mxf) current_channel = 0; - if (descriptor->channels >= FF_SANE_NB_CHANNELS) { - av_log(mxf->fc, AV_LOG_ERROR, "max number of channels %d reached\n", FF_SANE_NB_CHANNELS); + if (descriptor->channels <= 0 || descriptor->channels >= FF_SANE_NB_CHANNELS) { + av_log(mxf->fc, AV_LOG_ERROR, "Invalid number of channels %d, must be less than %d\n", descriptor->channels, FF_SANE_NB_CHANNELS); return AVERROR_INVALIDDATA; }