[4/4] quartz: FileSource_Load should not fail on unknown file formats. (v2)

Sebastian Lackner sebastian at fds-team.de
Thu Apr 28 14:57:47 CDT 2016


From: Michael Müller <michael at fds-team.de>

Signed-off-by: Michael Müller <michael at fds-team.de>
Signed-off-by: Sebastian Lackner <sebastian at fds-team.de>
---
Changes in v2:
* Added this follow-up patch.

 dlls/quartz/filesource.c        |    5 +++--
 dlls/quartz/tests/avisplitter.c |    6 ++++++
 2 files changed, 9 insertions(+), 2 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 5604f6d..f4997c9 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,
+            &MEDIASUBTYPE_NULL,
+        },
     };
     WCHAR path[MAX_PATH], temp[MAX_PATH];
     IFileSourceFilter *filesource;
-- 
2.8.0



More information about the wine-patches mailing list