From 47b8762774296c6e8f6ddcd349747aa6c5fbc5f5 Mon Sep 17 00:00:00 2001 From: Jan Lorenz Date: Wed, 23 Nov 2022 14:35:07 +0100 Subject: [PATCH] mfvideosrc: check HRESULT of CreateClassEnumerator correctly Fixes a crash during direct show device enumeration Fixes: https://gitlab.freedesktop.org/gstreamer/gstreamer/-/issues/1599 Part-of: --- .../gst-plugins-bad/sys/mediafoundation/gstmfcapturedshow.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/subprojects/gst-plugins-bad/sys/mediafoundation/gstmfcapturedshow.cpp b/subprojects/gst-plugins-bad/sys/mediafoundation/gstmfcapturedshow.cpp index 00144bfbf0..30ebe425e6 100644 --- a/subprojects/gst-plugins-bad/sys/mediafoundation/gstmfcapturedshow.cpp +++ b/subprojects/gst-plugins-bad/sys/mediafoundation/gstmfcapturedshow.cpp @@ -1023,7 +1023,8 @@ gst_mf_dshow_enum_device (GstMFCaptureDShow * self, return FALSE; } - if (!gst_mf_result (hr)) + // Documentation states that the result of CreateClassEnumerator must be checked against S_OK + if (hr != S_OK) return FALSE; for (guint i = 0;; i++) {