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 CF20840529 for ; Tue, 21 Dec 2021 12:13:14 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 6E71C68AED0; Tue, 21 Dec 2021 14:13:08 +0200 (EET) Received: from mail-lf1-f46.google.com (mail-lf1-f46.google.com [209.85.167.46]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 9800268AE95 for ; Tue, 21 Dec 2021 14:13:01 +0200 (EET) Received: by mail-lf1-f46.google.com with SMTP id g26so13050993lfv.11 for ; Tue, 21 Dec 2021 04:13:01 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=n4ECdPBbt8xqX/bDaPPPd4LEZ+alPN7BkD4xWH+ML2s=; b=AvnK3ci6hNOhWxThDfN2Bhrpawvtfpcgh/HNlvO+Xt/Fk+UYY/b9ikIdU2nH0sxXfc AU1ghM9neafM3XruwpCLhXqvUbnO6Fv1dKAV2DviA9E/JMPkfdQvNp/5v4FpgqU77GEY NBj1y3IgALLjNZTSr3EBeUPkUQDAXFRhbLtxUl7BwmXy+DQJJ0mYsLMAavSg6MpMeGXo DEijy14XJctx4Fuw4sDptQivoaLeC3jVfDaG3c0aGPiSrAAvhN0C7NkLwk5W7SNCqLzJ htZ4OZbQu+RIwnMBqJA2pMDnZCRM+STEUkkhARYowzcTqnoVV61pLMST5vaan9CKdDvn GgcQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=n4ECdPBbt8xqX/bDaPPPd4LEZ+alPN7BkD4xWH+ML2s=; b=ogZLCaVcAzJ7cuVx1CgmzlH5V7LvCpiQbwQBFKN2BzR7YO0A8Eu+lmeJceWKYVFl5n qpXi+kSbaxrP5T0ffyMNofXnR1HDQokAtULmlG4NpO/C3v0t4exr0TZb48FYNsnYrKS7 BhcO5JxCkL4UwZjsgGLVr9rWLpy4c3jqfbfiMfqTQgl95rB+x8DXN6rPdxcloCFe1VcL BvE1q1clo7Y9+cFcJhN7KeAvbhoooOHVxQg10sTq8F7q+KTW7Y63ctmTqOrPdD9icJQ8 /pEsRZ3OecANSiTdRpmqvveQ0oiktJoNEHq9sZNRjfNaNnthyqIGw5/of6ikHAe/n3fa M1JQ== X-Gm-Message-State: AOAM530ht/1IHEAHSDjDYYYR5HA/fJKBRPZaYlpfAwOSkUuUXVo36gBH 7ulhU5NcqHKusOIEDJefKZ39YFCo4qBRYg== X-Google-Smtp-Source: ABdhPJyEHP816eTAD4wHyoH23OYGw6V887p2G/zCOSygfdQ9gTaEU5ihdwLn6IM1qBUiWlZ35KjnDg== X-Received: by 2002:a05:6512:3b13:: with SMTP id f19mr2763696lfv.305.1640088780761; Tue, 21 Dec 2021 04:13:00 -0800 (PST) Received: from localhost.localdomain ([196.244.192.13]) by smtp.gmail.com with ESMTPSA id p4sm245760lfo.9.2021.12.21.04.13.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 21 Dec 2021 04:13:00 -0800 (PST) From: Diederick Niehorster To: ffmpeg-devel@ffmpeg.org Date: Tue, 21 Dec 2021 13:12:28 +0100 Message-Id: <20211221121239.1201-2-dcnieho@gmail.com> X-Mailer: git-send-email 2.28.0.windows.1 In-Reply-To: <20211221121239.1201-1-dcnieho@gmail.com> References: <20211221121239.1201-1-dcnieho@gmail.com> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH v6 01/12] avdevice/dshow: prevent NULL access 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 Cc: Diederick Niehorster 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: list_options true would crash when both a video and an audio device were specified as input. Crash would occur on line 784 because ctx->device_unique_name[otherDevType] would be NULL Signed-off-by: Diederick Niehorster --- libavdevice/dshow.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/libavdevice/dshow.c b/libavdevice/dshow.c index ef78781865..cc0bef0474 100644 --- a/libavdevice/dshow.c +++ b/libavdevice/dshow.c @@ -708,9 +708,9 @@ dshow_list_device_options(AVFormatContext *avctx, ICreateDevEnum *devenum, if ((r = dshow_cycle_devices(avctx, devenum, devtype, sourcetype, &device_filter, &device_unique_name)) < 0) return r; ctx->device_filter[devtype] = device_filter; + ctx->device_unique_name[devtype] = device_unique_name; if ((r = dshow_cycle_pins(avctx, devtype, sourcetype, device_filter, NULL)) < 0) return r; - av_freep(&device_unique_name); return 0; } @@ -1143,6 +1143,7 @@ static int dshow_read_header(AVFormatContext *avctx) } } } + // don't exit yet, allow it to list crossbar options in dshow_open_device } if (ctx->device_name[VideoDevice]) { if ((r = dshow_open_device(avctx, devenum, VideoDevice, VideoSourceDevice)) < 0 || -- 2.28.0.windows.1 _______________________________________________ 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".