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: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3460>
This commit is contained in:
Jan Lorenz 2022-11-23 14:35:07 +01:00 committed by GStreamer Marge Bot
parent 63ff99ca8e
commit 47b8762774

View file

@ -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++) {