[FFmpeg-cvslog] avdevice/dshow: Check device_filter_unique_name before use
Michael Niedermayer
git at videolan.org
Wed Jul 24 17:50:09 EEST 2024
ffmpeg | branch: release/4.3 | Michael Niedermayer <michael at niedermayer.cc> | Mon May 27 01:52:24 2024 +0200| [113960bb0297fb6c4ecce7cc1855a54e7f660311] | committer: Michael Niedermayer
avdevice/dshow: Check device_filter_unique_name before use
Fixes: CID1591931 Explicit null dereferenced
Sponsored-by: Sovereign Tech Fund
Reviewed-by: Roger Pack <rogerdpack at gmail.com>
Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>
(cherry picked from commit 175c19166824bd93b02f60c5178365014212366e)
Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=113960bb0297fb6c4ecce7cc1855a54e7f660311
---
libavdevice/dshow.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/libavdevice/dshow.c b/libavdevice/dshow.c
index 9a1a3d5395..1c1adee1ff 100644
--- a/libavdevice/dshow.c
+++ b/libavdevice/dshow.c
@@ -781,7 +781,7 @@ dshow_open_device(AVFormatContext *avctx, ICreateDevEnum *devenum,
if (ctx->device_filter[otherDevType]) {
// avoid adding add two instances of the same device to the graph, one for video, one for audio
// a few devices don't support this (could also do this check earlier to avoid double crossbars, etc. but they seem OK)
- if (strcmp(device_filter_unique_name, ctx->device_unique_name[otherDevType]) == 0) {
+ if (!device_filter_unique_name || strcmp(device_filter_unique_name, ctx->device_unique_name[otherDevType]) == 0) {
av_log(avctx, AV_LOG_DEBUG, "reusing previous graph capture filter... %s\n", device_filter_unique_name);
IBaseFilter_Release(device_filter);
device_filter = ctx->device_filter[otherDevType];
More information about the ffmpeg-cvslog
mailing list