[PATCH] qcap/filewriter: Avoid casting to DWORD in an ERR message.
Zebediah Figura
zfigura at codeweavers.com
Fri Apr 8 12:23:18 CDT 2022
Signed-off-by: Zebediah Figura <zfigura at codeweavers.com>
---
This supersedes 232052.
dlls/qcap/filewriter.c | 9 +++++----
1 file changed, 5 insertions(+), 4 deletions(-)
diff --git a/dlls/qcap/filewriter.c b/dlls/qcap/filewriter.c
index 43f6274ea8d..bc63abcb8cb 100644
--- a/dlls/qcap/filewriter.c
+++ b/dlls/qcap/filewriter.c
@@ -68,26 +68,27 @@ static HRESULT WINAPI file_writer_sink_receive(struct strmbase_sink *iface, IMed
struct file_writer *filter = impl_from_strmbase_pin(&iface->pin);
REFERENCE_TIME start, stop;
LARGE_INTEGER offset;
+ DWORD size, ret_size;
HRESULT hr;
- DWORD size;
BYTE *data;
if ((hr = IMediaSample_GetTime(sample, &start, &stop)) != S_OK)
ERR("Failed to get sample time, hr %#lx.\n", hr);
+ size = stop - start;
if ((hr = IMediaSample_GetPointer(sample, &data)) != S_OK)
ERR("Failed to get sample pointer, hr %#lx.\n", hr);
offset.QuadPart = start;
if (!SetFilePointerEx(filter->file, offset, NULL, FILE_BEGIN)
- || !WriteFile(filter->file, data, stop - start, &size, NULL))
+ || !WriteFile(filter->file, data, size, &ret_size, NULL))
{
ERR("Failed to write file, error %lu.\n", GetLastError());
return HRESULT_FROM_WIN32(hr);
}
- if (size != stop - start)
- ERR("Short write, %lu/%lu.\n", size, (DWORD)(stop - start));
+ if (ret_size != size)
+ ERR("Short write, %lu/%lu.\n", ret_size, size);
return S_OK;
}
--
2.35.1
More information about the wine-devel
mailing list