=?UTF-8?Q?Michael=20M=C3=BCller=20?=: quartz: FileSource_Load should not fail on unknown file formats.

Alexandre Julliard julliard at wine.codeweavers.com
Tue May 3 11:15:35 CDT 2016


Module: wine
Branch: master
Commit: 355a3248d4b239ad2442ca5245511c59aaa24952
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=355a3248d4b239ad2442ca5245511c59aaa24952

Author: Michael Müller <michael at fds-team.de>
Date:   Fri Apr 29 22:13:35 2016 +0200

quartz: FileSource_Load should not fail on unknown file formats.

Signed-off-by: Michael Müller <michael at fds-team.de>
Signed-off-by: Sebastian Lackner <sebastian at fds-team.de>
Signed-off-by: Andrew Eikum <aeikum at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 dlls/quartz/filesource.c        |  5 +++--
 dlls/quartz/tests/avisplitter.c | 17 +++++++++++++----
 2 files changed, 16 insertions(+), 6 deletions(-)

diff --git a/dlls/quartz/filesource.c b/dlls/quartz/filesource.c
index f0f85fd..269dd13 100644
--- a/dlls/quartz/filesource.c
+++ b/dlls/quartz/filesource.c
@@ -655,8 +655,9 @@ static HRESULT WINAPI FileSource_Load(IFileSourceFilter * iface, LPCOLESTR pszFi
             hr = GetClassMediaFile(pReader, pszFileName, &This->pmt->majortype, &This->pmt->subtype, NULL);
             if (FAILED(hr))
             {
-                CoTaskMemFree(This->pmt);
-                This->pmt = NULL;
+                This->pmt->majortype = MEDIATYPE_Stream;
+                This->pmt->subtype = MEDIASUBTYPE_NULL;
+                hr = S_OK;
             }
         }
         else
diff --git a/dlls/quartz/tests/avisplitter.c b/dlls/quartz/tests/avisplitter.c
index aa938c1..78ca8b8 100644
--- a/dlls/quartz/tests/avisplitter.c
+++ b/dlls/quartz/tests/avisplitter.c
@@ -217,6 +217,12 @@ static void test_filesourcefilter(void)
             12,
             &MEDIASUBTYPE_WAVE,
         },
+        {
+            "unknown format",
+            "Hello World",
+            11,
+            NULL, /* FIXME: should be &MEDIASUBTYPE_NULL */
+        },
     };
     WCHAR path[MAX_PATH], temp[MAX_PATH];
     IFileSourceFilter *filesource;
@@ -277,10 +283,13 @@ static void test_filesourcefilter(void)
         ok(hr == S_OK, "expected S_OK, got %08x\n", hr);
         ok(!lstrcmpW(olepath, path),
            "expected %s, got %s\n", wine_dbgstr_w(path), wine_dbgstr_w(olepath));
-        ok(IsEqualGUID(&mt.majortype, &MEDIATYPE_Stream),
-           "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));
+        if (tests[i].subtype)
+        {
+            ok(IsEqualGUID(&mt.majortype, &MEDIATYPE_Stream),
+               "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);
 
         IFileSourceFilter_Release(filesource);




More information about the wine-cvs mailing list