Signed-off-by: Jactry Zeng jzeng@codeweavers.com --- dlls/qcap/vfwcapture.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/dlls/qcap/vfwcapture.c b/dlls/qcap/vfwcapture.c index 967bdba22e..14542ec7fc 100644 --- a/dlls/qcap/vfwcapture.c +++ b/dlls/qcap/vfwcapture.c @@ -522,11 +522,13 @@ static HRESULT source_get_media_type(struct strmbase_pin *pin, VfwCapture *filter = impl_from_strmbase_pin(pin); AM_MEDIA_TYPE *vfw_pmt; HRESULT hr; + LONG count;
- if (iPosition > 0) + count = qcap_driver_get_caps_count(filter->driver_info); + if (iPosition >= count) return VFW_S_NO_MORE_ITEMS;
- hr = qcap_driver_get_format(filter->driver_info, &vfw_pmt); + hr = qcap_driver_get_caps(filter->driver_info, iPosition, &vfw_pmt, NULL); if (SUCCEEDED(hr)) { CopyMediaType(pmt, vfw_pmt); DeleteMediaType(vfw_pmt);