History

avdevice/dshow: Check device_filter_unique_name before use

Fixes: CID1591931 Explicit null dereferenced

Michael Niedermayer committed 2 years ago

Commit 175c1911 parent 25f92111 file · +1 −1Browse files

Unified · Split

libavdevice/dshow.c+1−1
@@ -1373,7 +1373,7 @@ dshow_open_device(AVFormatContext *avctx, ICreateDevEnum *devenum, · 1372 unmodified lines
13731373 if (ctx->device_filter[otherDevType]) {
13741374 // avoid adding add two instances of the same device to the graph, one for video, one for audio
13751375 // a few devices don't support this (could also do this check earlier to avoid double crossbars, etc. but they seem OK)
1376− if (strcmp(device_filter_unique_name, ctx->device_unique_name[otherDevType]) == 0) {
1376+ if (!device_filter_unique_name || strcmp(device_filter_unique_name, ctx->device_unique_name[otherDevType]) == 0) {
13771377 av_log(avctx, AV_LOG_DEBUG, "reusing previous graph capture filter... %s\n", device_filter_unique_name);
13781378 IBaseFilter_Release(device_filter);
13791379 device_filter = ctx->device_filter[otherDevType];

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t