From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org [79.124.17.100]) by master.gitmailbox.com (Postfix) with ESMTP id 4C70F459DA for ; Wed, 1 Mar 2023 00:05:40 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id DE29468AB9A; Wed, 1 Mar 2023 02:05:38 +0200 (EET) Received: from mail-wr1-f46.google.com (mail-wr1-f46.google.com [209.85.221.46]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id B1D57689CBE for ; Wed, 1 Mar 2023 02:05:32 +0200 (EET) Received: by mail-wr1-f46.google.com with SMTP id l25so11545102wrb.3 for ; Tue, 28 Feb 2023 16:05:32 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=user-agent:in-reply-to:content-disposition:mime-version:references :mail-followup-to:message-id:subject:to:from:date:from:to:cc:subject :date:message-id:reply-to; bh=Vkiod653g/OP/kK0Zu+7f9W6PC+aIkHHKZBC30aq32s=; b=dkKZR0uTmIpXxCZuKqpGmNBg/C0m7aMpc1kKIgpjTfS+AEh9HrEOsqUf2TiG67HJod jUFQSkZSJ/d7YjgQpMmQXRJFZzCTFCSp94t+1BAC/+V9/eCLoM3lGTSy1pLLHKUkfj3D KsILEcwcN1XWCLTAwHu6ghvjJi30X7QoCMRxxACrZpk2TuMCtJ+PdpKY3vWEmPBR07DA 0l9Bm3VRgejFXEM+AVpmQfG/aHAONKbaf62WNJR7h7B9eO1hRYKWgNhGhIQuX4MkWN+u 9rPsBfUr/TEBA69yKS0mQQvA4fAIYwtuaSXvtZ33U5tQM9u3ojmERs+odiAs5xIb1/Ie 9VDA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=user-agent:in-reply-to:content-disposition:mime-version:references :mail-followup-to:message-id:subject:to:from:date:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=Vkiod653g/OP/kK0Zu+7f9W6PC+aIkHHKZBC30aq32s=; b=Go4HiCbXuUAPLt/qpZS6TjkNkn3BpsvsQRIeNr0tTKjjMH1UYIc7RUZX5tyUpDGglj ApV7hRb0o3XaTWWo+EAsaUbO52yRCsXFkdGHPHJGONhR59iipKdSEV07sPgnO7LbIHYm iFPx84AOUCERvgwLYV+vC86d+QfjAGVrZgT0DYoHWTjo2rOKZfAok+64D60V7yliG/t1 S9uf1OKUVVuBkF3BtxvlUaWWgVjwCQ03uT1uAPd+hCvHnuX+hLKvAa0ZJbiBnxD+gry0 XJVbbzkkvMTEPshYfenl+KlzvKS88vPgeofhKMRs4OIcUpxDDIQfpe95yF4bRDpu8crO gbFA== X-Gm-Message-State: AO0yUKVTZWiNBMC4dhnt4fF2EFBPLB69f5JjSnbhqmKZYtc3rWhbqWOx EI0QXjhpunfBrd50Phu1434OavFPWLIZJg== X-Google-Smtp-Source: AK7set+rbHvVpA6JlwXd1z+xDcsPfMThPLJBKEesCom1hTsGWyUmEGb3+ewBpW67zqXRHhepW3Nh5g== X-Received: by 2002:adf:dd0b:0:b0:2c7:bbe:456c with SMTP id a11-20020adfdd0b000000b002c70bbe456cmr3289332wrm.63.1677629131383; Tue, 28 Feb 2023 16:05:31 -0800 (PST) Received: from mariano (94-37-133-75.adsl-ull.clienti.tiscali.it. [94.37.133.75]) by smtp.gmail.com with ESMTPSA id m7-20020adfe947000000b002c70f5627d5sm10822020wrn.63.2023.02.28.16.05.30 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 28 Feb 2023 16:05:30 -0800 (PST) Received: by mariano (Postfix, from userid 1000) id E9DF1BFB73; Wed, 1 Mar 2023 01:05:29 +0100 (CET) Date: Wed, 1 Mar 2023 01:05:29 +0100 From: Stefano Sabatini To: FFmpeg development discussions and patches Message-ID: <20230301000529.GE25822@mariano> Mail-Followup-To: FFmpeg development discussions and patches References: <20230301000126.49666-1-stefasab@gmail.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20230301000126.49666-1-stefasab@gmail.com> User-Agent: Mutt/1.13.2 (2019-12-18) Subject: Re: [FFmpeg-devel] [PATCH] lavfi/buffersrc: issue more specific error in case of invalid parameters 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 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Archived-At: List-Archive: List-Post: On date Wednesday 2023-03-01 01:01:26 +0100, Stefano Sabatini wrote: > --- > libavfilter/buffersrc.c | 13 ++++++++++--- > 1 file changed, 10 insertions(+), 3 deletions(-) > > diff --git a/libavfilter/buffersrc.c b/libavfilter/buffersrc.c > index ba17450b93..ea9556d691 100644 > --- a/libavfilter/buffersrc.c > +++ b/libavfilter/buffersrc.c > @@ -273,9 +273,16 @@ static av_cold int init_video(AVFilterContext *ctx) > { > BufferSourceContext *c = ctx->priv; > > - if (c->pix_fmt == AV_PIX_FMT_NONE || !c->w || !c->h || > - av_q2d(c->time_base) <= 0) { > - av_log(ctx, AV_LOG_ERROR, "Invalid parameters provided.\n"); > + if (c->pix_fmt == AV_PIX_FMT_NONE) { > + av_log(ctx, AV_LOG_ERROR, "Unspecified pixel format\n"); > + return AVERROR(EINVAL); > + } > + if (!c->w || !c->h) { > + av_log(ctx, AV_LOG_ERROR, "Invalid null size %dx%d\n", c->w, c->h); > + return AVERROR(EINVAL); > + } > + if (av_q2d(c->time_base) <= 0) { > + av_log(ctx, AV_LOG_ERROR, "Invalid time base %d/%d\n", c->time_base.num, c->time_base.den); > return AVERROR(EINVAL); > } BTW, I noticied this as part of debugging transcode.c (which looks broken at the moment), since the timebase is read as 0/1 from the decoder context, it would be a valid value when reading from the AVStream (but this information is not copied by avcodec_parameters_to_context). In decode_filter_video.c this is indeed "fixed" by copying the timebase directly from the AVStream. Is this expected? Shouldn't the timebase be copied to the decoder context? _______________________________________________ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".