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 CDAF2401B9 for ; Sun, 19 Dec 2021 19:22:11 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 69E9768AF07; Sun, 19 Dec 2021 21:22:07 +0200 (EET) Received: from mail-lf1-f49.google.com (mail-lf1-f49.google.com [209.85.167.49]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id D905C68AE3C for ; Sun, 19 Dec 2021 21:22:00 +0200 (EET) Received: by mail-lf1-f49.google.com with SMTP id g11so16989802lfu.2 for ; Sun, 19 Dec 2021 11:22:00 -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=oPHAlvbNWEF82tmf0ghVIbN03pR+AEsCmszKUtWH1AurTBQEjq8lO2x3Vs1E3zBihT dIzsQ1WXA7adDsn5sVSFEWAaF054CSDTRxfbEO21dYqO4AL3Y1yHwvuRql2nNNBCWT8r AxuCoYKR87aWemga8ObmxFJotMnI/edZgGDuC4GgCwGSGual+Md+BHTJa7HM2cFhgG5x NK/JSn1Poc2cq4ZWncVeJYaInwemCObuZnQF45LIabr6Eb8F0jc6U+tOxR2H8/vWo4ad x+Y1GN4TOJysRIQs+pjFdTEJk9V+TmCN6MR1kX7gXPGhihFSUm5pVI7lsxOBi1HHokAY Sx7A== 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=sPICOxOHPg637Ko2kMW74Pi+Id3ZfJnblq8Y4dumDYBVpf15Wl1VG0ZHO0zR+lEI2N 7y2KFtXFOiDjNRPFAhywYpHKqB1bezRQ8/h9c0NTVUGcnSGVmAB0sYRwnLldsxLABMhw HMuSEBx94t8/ycLhI1ABOnQrt5piRsMlMTfOpDDfSEg4PDtnXSY1Wc9vEL14pzX2p7Oq Ul7r7eniSw6w0XPqs71r4UnTwr20KXYZ/bMMoyg7/+HoJ53ZKZ5W5ZJOVDB+kz+2Tjf6 Ws8OL8nLX9dAbPxYyPeVkLEB+ucQau682bKU0OzrpQ3fhmjdF7vJ3vjmcrY4BdG+W0pF VAwQ== X-Gm-Message-State: AOAM533SJ2JyBOxeARoWNLwyy+fq74ziH1oZOJigOAf0q7SC/MnGVM7g YpvnDFdu4AgcpYU/vbs8Qlr7sk3v9tIEtMtf X-Google-Smtp-Source: ABdhPJxNZ2I5OG2uVH2ijRsNKI2FVhkvwygj7Ady4eN853SPS2T6vI7939cwPvX38uBFKhczT/v4UQ== X-Received: by 2002:ac2:59c8:: with SMTP id x8mr6672053lfn.573.1639941719534; Sun, 19 Dec 2021 11:21:59 -0800 (PST) Received: from localhost.localdomain (84-217-56-54.customers.ownit.se. [84.217.56.54]) by smtp.gmail.com with ESMTPSA id be25sm2320921ljb.114.2021.12.19.11.21.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 19 Dec 2021 11:21:59 -0800 (PST) From: Diederick Niehorster To: ffmpeg-devel@ffmpeg.org Date: Sun, 19 Dec 2021 20:21:22 +0100 Message-Id: <20211219192134.1296-2-dcnieho@gmail.com> X-Mailer: git-send-email 2.28.0.windows.1 In-Reply-To: <20211219192134.1296-1-dcnieho@gmail.com> References: <20211219192134.1296-1-dcnieho@gmail.com> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH v5 01/13] 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".