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 0E6C14057B for ; Tue, 21 Dec 2021 13:54:18 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 14C8368AF87; Tue, 21 Dec 2021 15:54:07 +0200 (EET) Received: from mail-lf1-f53.google.com (mail-lf1-f53.google.com [209.85.167.53]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id DEAF768AC7B for ; Tue, 21 Dec 2021 15:53:59 +0200 (EET) Received: by mail-lf1-f53.google.com with SMTP id g26so13691772lfv.11 for ; Tue, 21 Dec 2021 05:53:59 -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=ZyhtH3VI25wz63r3pof9/n6sS4j/Vf3jbHUK+/Dm2v8ceP7u8FWv7a2yXPrs+hytRG /mnS71apZ6IlEflb5d3NH5574bnDyURhmDGaW9uxGN8DpNj3/5uUWJ2iXuquXfKbkKCB ZE/PVzUJA7zv8EfgduN/hC2cFZk9bqJeKhAEK/ZAeqBCtobhaiK4jIFHld7E8/JZaIvB U94pgDk32nUHLMcrD3geVLip0vZy4zXF78OeJt4+OnbkoqO8ag86mxrulcQsAuQwJC7v 0XqG03Tkd8cqSswwP7K85fWke3I+q9YuOf8XRhvXg6EkDzxhBr3xsZ46M/1xRGdg9wZw xcOw== 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=LqRQwbfSqwQPin4Kss4s9ehQtT1lAuSN9/dR4T1CFpzLNshaXkiEA2XK5B3InA5lmQ wCAIUhH2Vm9GB1f+9awEnk34DQJ2pFF/P+S+fhwuxkrRogFdkHqi37MAK9JueJZoPrQh c7rP2E7vb1nBA1ZXWVpQ2pcygruVdAk/EKIncYaKyVIlrlmC9I5BxAm2BowS+C8XOFQw EomiQtQZZguiziK+4ktH+BGLEImsX8X53ndX/ihDrI1Vq5GgHQXrt4zK1uLk69A9Z4QO d/OY2qE692FBWYM+Cq1Dog24Owbg+jNAyzrwdKqu/hPmrwJYBmRxMTjWK5giXoMsNdsR vtpw== X-Gm-Message-State: AOAM530+ObNC3fM0howZa8+WotIP1OBBFbhB2tOuIrVfEPcncVb4vGSn /gwJJ5GZAsCHgANtGwbZ4UhKrKHdo1rXNw== X-Google-Smtp-Source: ABdhPJxBAziZGmazPWV9MFm1UCWVmZ7kBGnFBwNxjUolfzElhTqB2lF4vkmbkSeJNTSStwcuOpv4xA== X-Received: by 2002:a05:6512:1194:: with SMTP id g20mr3110921lfr.58.1640094839044; Tue, 21 Dec 2021 05:53:59 -0800 (PST) Received: from localhost.localdomain ([196.244.192.13]) by smtp.gmail.com with ESMTPSA id e12sm990474lfr.179.2021.12.21.05.53.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 21 Dec 2021 05:53:58 -0800 (PST) From: Diederick Niehorster To: ffmpeg-devel@ffmpeg.org Date: Tue, 21 Dec 2021 14:53:26 +0100 Message-Id: <20211221135337.1348-2-dcnieho@gmail.com> X-Mailer: git-send-email 2.28.0.windows.1 In-Reply-To: <20211221135337.1348-1-dcnieho@gmail.com> References: <20211221135337.1348-1-dcnieho@gmail.com> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH v7 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".