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@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Zebediah Figura 2021-10-06 11:46:35 -05:00 committed by Alexandre Julliard
parent 585acfa041
commit 3efb72de5a

View file

@ -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);