From patchwork Sun Jun 4 19:53:22 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Niedermayer X-Patchwork-Id: 41978 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a20:c51c:b0:10c:5e6f:955f with SMTP id gm28csp2640185pzb; Sun, 4 Jun 2023 12:53:37 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5KepTFozyTsGAxkeUAaN7dQMNQvTqr6tl1kIFXiqi4emNdBL2wpvDJfLqUmm8gmjts10QS X-Received: by 2002:a05:6402:134b:b0:515:46f2:d3bf with SMTP id y11-20020a056402134b00b0051546f2d3bfmr5301090edw.40.1685908417390; Sun, 04 Jun 2023 12:53:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1685908417; cv=none; d=google.com; s=arc-20160816; b=QXnMn1NdpMXkzJBoV0lcSs0YPxEo4iauRnyTv2Vnka3KYSuuDyvpSgYjhxoA3IQiIi R46XJe3m2Wt3vz6i3IEhXlAHOug9/r5jlWUKsWYnB8XvP1rAQ3yEVgcVj5gP0BuHwgyw riA5Xm4HnAfKZEXWlBVSuGrf/TOqGucyd8bZJOYknYvQ/op5BLBj306V5TPfnGitKrK1 IYnrJnvuAVAkllQ1Y9isDZGDIkA/Pu7GNIMxNFhvNA3C9hw9ZGeIUkk5jTf9qaTgu0kb Kbd1qNzKw8E5zxFjx58g3Gt3DUrp6ggmujDUV3BqcVh3G30Ta0TR+1xQ5KQXm0HggvQr YSNA== 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:message-id:date:to:from:delivered-to; bh=ZbTFLibpOiA6bgJLBz6VmciBnr8yh7PnGwUB5PIMovk=; b=GDbYLITVVXClUqZNK70anErOyUaJcRjpcBqQHESjgPfuyTfM4Ix1/vst1NOOdI6c5U 2U1JlhMgk8yDLcZ1slJmMLWzhVF9yX4NSD35bNO6xJ1TUuGwdUxr5E4zvNa43YrXcnAj 9DSjjZU8WH8fIe8DZ+sZjaRl7m54z8jSTDp7CjKKD1CEYOVdJGgT5gCl8RaJ0ZLWF+Gt 6VfjFsjRUoi/I5oFLrWJEaVXbQZvHfjQtPBG2y0BmL1n21F5ZyYL/gHhaNCEyse7pH0m V+8NPTL+eNq+b3GHwxdEt3Kh8CFooxzCEFpoMg7HleI2UYz96nAJDgJJMi6udmSsH1yY mWAg== 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 c15-20020a056402120f00b00515b9e4b07bsi3959567edw.642.2023.06.04.12.53.36; Sun, 04 Jun 2023 12:53:37 -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 9A6A268C37C; Sun, 4 Jun 2023 22:53:33 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from relay1-d.mail.gandi.net (relay1-d.mail.gandi.net [217.70.183.193]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 1C3EF68BFDA for ; Sun, 4 Jun 2023 22:53:27 +0300 (EEST) X-GND-Sasl: michael@niedermayer.cc Received: by mail.gandi.net (Postfix) with ESMTPSA id CC702240003 for ; Sun, 4 Jun 2023 19:53:25 +0000 (UTC) From: Michael Niedermayer To: FFmpeg development discussions and patches Date: Sun, 4 Jun 2023 21:53:22 +0200 Message-Id: <20230604195322.26982-1-michael@niedermayer.cc> X-Mailer: git-send-email 2.17.1 Subject: [FFmpeg-devel] [PATCH v2] avcodec/noise_bsf: Check for wrapped frames 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 MIME-Version: 1.0 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" X-TUID: vj+/8K0hRQgc Wrapped frames contain pointers so they need specific code to noise them, the generic code would lead to segfaults Signed-off-by: Michael Niedermayer --- libavcodec/noise_bsf.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/libavcodec/noise_bsf.c b/libavcodec/noise_bsf.c index 168f3aa373..2985a8ec4f 100644 --- a/libavcodec/noise_bsf.c +++ b/libavcodec/noise_bsf.c @@ -86,6 +86,13 @@ static int noise_init(AVBSFContext *ctx) return AVERROR(ENOMEM); } + if (ctx->par_in->codec_id == AV_CODEC_ID_WRAPPED_AVFRAME && + strcmp(s->amount_str, "0") + ) { + av_log(ctx, AV_LOG_ERROR, "Wrapped AVFrame noising is unsupported\n"); + return AVERROR_PATCHWELCOME; + } + ret = av_expr_parse(&s->amount_pexpr, s->amount_str, var_names, NULL, NULL, NULL, NULL, 0, ctx); if (ret < 0) {