[PATCH 4/5] winegstreamer: Avoid seeking past the end of an IMFByteStream.

Zebediah Figura zfigura at codeweavers.com
Tue Oct 5 23:50:29 CDT 2021


Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=51837
Signed-off-by: Zebediah Figura <zfigura at codeweavers.com>
---
 dlls/winegstreamer/media_source.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/dlls/winegstreamer/media_source.c b/dlls/winegstreamer/media_source.c
index dab85e4689d..c8b8be50c8c 100644
--- a/dlls/winegstreamer/media_source.c
+++ b/dlls/winegstreamer/media_source.c
@@ -639,6 +639,11 @@ static DWORD CALLBACK read_thread(void *arg)
         else if (offset + size >= file_size)
             size = file_size - offset;
 
+        /* Some IMFByteStreams (including the standard file-based stream) return
+         * an error when reading past the file size. */
+        if (!size)
+            wg_parser_push_data(source->wg_parser, data, 0);
+
         if (!array_reserve(&data, &buffer_size, size, 1))
         {
             free(data);
-- 
2.33.0




More information about the wine-devel mailing list