mirror of
https://github.com/baldurk/renderdoc.git
synced 2026-10-22 03:51:06 +00:00
Handle invalid filenames passed to CopyCaptureToRemote
This commit is contained in:
2 files changed
+17
-1
No files matched your search
@@ -1497,11 +1497,20 @@ void RemoteServer::CopyCaptureFromRemote(const char *remotepath, const char *loc
|
||||
|
||||
rdcstr RemoteServer::CopyCaptureToRemote(const char *filename, RENDERDOC_ProgressCallback progress)
|
||||
{
|
||||
FILE *fileHandle = FileIO::fopen(filename, "rb");
|
||||
|
||||
if(!fileHandle)
|
||||
{
|
||||
RDCERR("Can't open file '%s'", filename);
|
||||
return "";
|
||||
}
|
||||
|
||||
{
|
||||
WRITE_DATA_SCOPE();
|
||||
SCOPED_SERIALISE_CHUNK(eRemoteServer_CopyCaptureToRemote);
|
||||
|
||||
StreamReader fileStream(FileIO::fopen(filename, "rb"));
|
||||
// this will take ownership of and close the file
|
||||
StreamReader fileStream(fileHandle);
|
||||
ser.SerialiseStream(filename, fileStream, progress);
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user