Commit 355a3248 authored by Michael Müller's avatar Michael Müller Committed by Alexandre Julliard

quartz: FileSource_Load should not fail on unknown file formats.

parent a5fcc4d2
...@@ -655,8 +655,9 @@ static HRESULT WINAPI FileSource_Load(IFileSourceFilter * iface, LPCOLESTR pszFi ...@@ -655,8 +655,9 @@ static HRESULT WINAPI FileSource_Load(IFileSourceFilter * iface, LPCOLESTR pszFi
hr = GetClassMediaFile(pReader, pszFileName, &This->pmt->majortype, &This->pmt->subtype, NULL); hr = GetClassMediaFile(pReader, pszFileName, &This->pmt->majortype, &This->pmt->subtype, NULL);
if (FAILED(hr)) if (FAILED(hr))
{ {
CoTaskMemFree(This->pmt); This->pmt->majortype = MEDIATYPE_Stream;
This->pmt = NULL; This->pmt->subtype = MEDIASUBTYPE_NULL;
hr = S_OK;
} }
} }
else else
......
...@@ -217,6 +217,12 @@ static void test_filesourcefilter(void) ...@@ -217,6 +217,12 @@ static void test_filesourcefilter(void)
12, 12,
&MEDIASUBTYPE_WAVE, &MEDIASUBTYPE_WAVE,
}, },
{
"unknown format",
"Hello World",
11,
NULL, /* FIXME: should be &MEDIASUBTYPE_NULL */
},
}; };
WCHAR path[MAX_PATH], temp[MAX_PATH]; WCHAR path[MAX_PATH], temp[MAX_PATH];
IFileSourceFilter *filesource; IFileSourceFilter *filesource;
...@@ -277,10 +283,13 @@ static void test_filesourcefilter(void) ...@@ -277,10 +283,13 @@ static void test_filesourcefilter(void)
ok(hr == S_OK, "expected S_OK, got %08x\n", hr); ok(hr == S_OK, "expected S_OK, got %08x\n", hr);
ok(!lstrcmpW(olepath, path), ok(!lstrcmpW(olepath, path),
"expected %s, got %s\n", wine_dbgstr_w(path), wine_dbgstr_w(olepath)); "expected %s, got %s\n", wine_dbgstr_w(path), wine_dbgstr_w(olepath));
ok(IsEqualGUID(&mt.majortype, &MEDIATYPE_Stream), if (tests[i].subtype)
"expected MEDIATYPE_Stream, got %s\n", wine_dbgstr_guid(&mt.majortype)); {
ok(IsEqualGUID(&mt.subtype, tests[i].subtype), ok(IsEqualGUID(&mt.majortype, &MEDIATYPE_Stream),
"expected %s, got %s\n", wine_dbgstr_guid(tests[i].subtype), wine_dbgstr_guid(&mt.subtype)); "expected MEDIATYPE_Stream, got %s\n", wine_dbgstr_guid(&mt.majortype));
ok(IsEqualGUID(&mt.subtype, tests[i].subtype),
"expected %s, got %s\n", wine_dbgstr_guid(tests[i].subtype), wine_dbgstr_guid(&mt.subtype));
}
CoTaskMemFree(olepath); CoTaskMemFree(olepath);
IFileSourceFilter_Release(filesource); IFileSourceFilter_Release(filesource);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment