Zebediah Figura : quartz/memallocator: Forbid setting the start media time without setting the end time.

Alexandre Julliard julliard at winehq.org
Tue Jun 25 17:25:50 CDT 2019


Module: wine
Branch: master
Commit: 44318feeb659588175958101b7551d046c9773a5
URL:    https://source.winehq.org/git/wine.git/?a=commit;h=44318feeb659588175958101b7551d046c9773a5

Author: Zebediah Figura <z.figura12 at gmail.com>
Date:   Mon Jun 24 20:05:16 2019 -0500

quartz/memallocator: Forbid setting the start media time without setting the end time.

Signed-off-by: Zebediah Figura <z.figura12 at gmail.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 dlls/quartz/memallocator.c       | 21 ++++++++++-----------
 dlls/quartz/tests/memallocator.c |  2 +-
 2 files changed, 11 insertions(+), 12 deletions(-)

diff --git a/dlls/quartz/memallocator.c b/dlls/quartz/memallocator.c
index ac12abd..1d74c3c 100644
--- a/dlls/quartz/memallocator.c
+++ b/dlls/quartz/memallocator.c
@@ -734,21 +734,20 @@ static HRESULT WINAPI StdMediaSample2_GetMediaTime(IMediaSample2 * iface, LONGLO
     return S_OK;
 }
 
-static HRESULT WINAPI StdMediaSample2_SetMediaTime(IMediaSample2 * iface, LONGLONG * pStart, LONGLONG * pEnd)
+static HRESULT WINAPI StdMediaSample2_SetMediaTime(IMediaSample2 *iface, LONGLONG *start, LONGLONG *end)
 {
-    StdMediaSample2 *This = impl_from_IMediaSample2(iface);
-
-    TRACE("(%p)->(%p, %p)\n", iface, pStart, pEnd);
+    StdMediaSample2 *sample = impl_from_IMediaSample2(iface);
 
-    if (pStart)
-        This->tMediaStart = *pStart;
-    else
-        This->tMediaStart = INVALID_MEDIA_TIME;
+    TRACE("sample %p, start %p, end %p.\n", iface, start, end);
 
-    if (pEnd)
-        This->tMediaEnd = *pEnd;
+    if (start)
+    {
+        if (!end) return E_POINTER;
+        sample->tMediaStart = *start;
+        sample->tMediaEnd = *end;
+    }
     else
-        This->tMediaEnd = 0;
+        sample->tMediaStart = INVALID_MEDIA_TIME;
 
     return S_OK;
 }
diff --git a/dlls/quartz/tests/memallocator.c b/dlls/quartz/tests/memallocator.c
index b4f3b23..3868312 100644
--- a/dlls/quartz/tests/memallocator.c
+++ b/dlls/quartz/tests/memallocator.c
@@ -379,7 +379,7 @@ static void test_media_time(void)
     {
         start = 0x123;
         hr = IMediaSample_SetMediaTime(sample, &start, NULL);
-        todo_wine ok(hr == E_POINTER, "Got hr %#x.\n", hr);
+        ok(hr == E_POINTER, "Got hr %#x.\n", hr);
     }
 
     end = 0x321;




More information about the wine-cvs mailing list