[PATCH 2/4] quartz/filesource: Check for past EOF read in _Request().

Paul Gofman pgofman at codeweavers.com
Sun Apr 19 18:05:59 CDT 2020


On Vista+ ReadFile() returns FALSE and sets ERROR_IO_PENDING even if the
requested read results in ERROR_HANDLE_EOF. This change fixes
filesource test with Wine quartz.dll on Windows and avoids regression
otherwise triggered by the next patch.

Signed-off-by: Paul Gofman <pgofman at codeweavers.com>
---
 dlls/quartz/filesource.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/dlls/quartz/filesource.c b/dlls/quartz/filesource.c
index 8983f7317b..a553b8517e 100644
--- a/dlls/quartz/filesource.c
+++ b/dlls/quartz/filesource.c
@@ -723,6 +723,9 @@ static HRESULT WINAPI FileAsyncReader_Request(IAsyncReader *iface, IMediaSample
     if (FAILED(hr = IMediaSample_GetTime(sample, &start, &end)))
         return hr;
 
+    if (BYTES_FROM_MEDIATIME(start) >= filter->file_size.QuadPart)
+        return HRESULT_FROM_WIN32(ERROR_HANDLE_EOF);
+
     if (FAILED(hr = IMediaSample_GetPointer(sample, &data)))
         return hr;
 
-- 
2.25.3




More information about the wine-devel mailing list