Zebediah Figura : winegstreamer: Avoid seeking past the end of an IMFByteStream.

Alexandre Julliard julliard at winehq.org
Wed Oct 6 15:51:39 CDT 2021


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

Author: Zebediah Figura <zfigura at codeweavers.com>
Date:   Wed Oct  6 11:46:35 2021 -0500

winegstreamer: Avoid seeking past the end of an IMFByteStream.

Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=51837
Signed-off-by: Zebediah Figura <zfigura at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 dlls/winegstreamer/media_source.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/dlls/winegstreamer/media_source.c b/dlls/winegstreamer/media_source.c
index dab85e4689d..6ecd345cb73 100644
--- a/dlls/winegstreamer/media_source.c
+++ b/dlls/winegstreamer/media_source.c
@@ -639,6 +639,14 @@ 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);
+            continue;
+        }
+
         if (!array_reserve(&data, &buffer_size, size, 1))
         {
             free(data);




More information about the wine-cvs mailing list