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 0ED9A486DC for ; Thu, 14 Dec 2023 14:10:04 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id E143768D23B; Thu, 14 Dec 2023 16:10:00 +0200 (EET) Received: from haasn.dev (haasn.dev [78.46.187.166]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 820F968CFCC for ; Thu, 14 Dec 2023 16:09:53 +0200 (EET) Received: from haasn.dev (unknown [10.30.0.2]) by haasn.dev (Postfix) with ESMTP id 10B524B5C8 for ; Thu, 14 Dec 2023 15:09:52 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=haasn.xyz; s=mail; t=1702562992; bh=RHwB7dfo1kQySl8lJdJWfW0b0+kHTtJaRajvsaRWItA=; h=Date:From:To:Subject:In-Reply-To:References:From; b=PGhuj9LYJEmXk/ecVtOlm/JZON70uHQqUhJmk5D962ikojVMLyuxoqlXscI86+Ksl +3zFfw4pCaMEFVUFMkx8NJ9085jrJmov+UmmuoHs6137Rurmn9YjsTlFYWPoZ6VXOT d1mowtL8ka9vmjrCtdLXthW1NAjJ5iXUY/oy+cdg= Date: Thu, 14 Dec 2023 15:09:51 +0100 Message-ID: <20231214150951.GB31889@haasn.xyz> From: Niklas Haas To: FFmpeg development discussions and patches In-Reply-To: <20231214030948.GH6420@pb2> References: <20231213131536.10242-1-ffmpeg@haasn.xyz> <20231213131536.10242-4-ffmpeg@haasn.xyz> <20231214030948.GH6420@pb2> MIME-Version: 1.0 Content-Disposition: inline Subject: Re: [FFmpeg-devel] [PATCH v2 03/15] avfilter: add negotiation API for color space/range 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: > segfaults > > ./ffmpeg -f lavfi -i "amovie=fate-suite/wavpack/num_channels/eva_2.22_6.1_16bit-partial.wv,asplit=3[out1][a][b]; [a]showwaves=s=340x240,pad=iw:ih*2[waves]; [b]showspectrum=s=340x240[spectrum]; [waves][spectrum] overlay=0:h [out0]" -t 0.1 -qscale 2 -bitexact /tmp/file-waves.avi > > Thread 1 "ffmpeg_g" received signal SIGSEGV, Segmentation fault. > 0x00005555557a7c07 in query_formats () > (gdb) bt > #0 0x00005555557a7c07 in query_formats () > #1 0x00005555557a84d5 in avfilter_graph_config () > #2 0x000055555569ac0a in lavfi_read_header () > #3 0x0000555555a7bd61 in avformat_open_input () > #4 0x000055555574cb43 in ifile_open () > #5 0x0000555555763c49 in open_files.isra () > #6 0x0000555555765327 in ffmpeg_parse_options () > #7 0x00005555557442b4 in main () > > (i can provide better backtrace if you cannot reproduce ...) The culprit appears to be from this logic in formats.c: case FF_FILTER_FORMATS_PASSTHROUGH: case FF_FILTER_FORMATS_QUERY_FUNC: type = ctx->nb_inputs ? ctx->inputs [0]->type : ctx->nb_outputs ? ctx->outputs[0]->type : AVMEDIA_TYPE_VIDEO; formats = ff_all_formats(type); break; In the case of an a/v filter (like avf_showspectrum), this incorrectly determines the filter type as an audio filter, and therefore does not run the default configuration logic on the video *output*. Indeed, this logic would appear to break also in the case of a (hypothetical) video->audio conversion filter, in which case channel counts and samplerates would similarly fail to get assigned, because the filter type would be incorrectly determined to be a video filter. I think the correct resolution here would be to simply remove these conditionals and always run ff_set_common_* in ff_default_query_formats. They already explicitly ignore inputs/outputs of mismatching type, and are a no-op if there is nothing to ref. _______________________________________________ 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".