From e6a9632d81e6e60e127228c662a512759215f00d Mon Sep 17 00:00:00 2001 From: baldurk Date: Mon, 30 Mar 2020 10:23:21 +0100 Subject: [PATCH] Do not allow non-absolute paths when saving textures. Closes #1795 --- qrenderdoc/Windows/Dialogs/TextureSaveDialog.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/qrenderdoc/Windows/Dialogs/TextureSaveDialog.cpp b/qrenderdoc/Windows/Dialogs/TextureSaveDialog.cpp index 691fd7c62..cec48a00d 100644 --- a/qrenderdoc/Windows/Dialogs/TextureSaveDialog.cpp +++ b/qrenderdoc/Windows/Dialogs/TextureSaveDialog.cpp @@ -662,6 +662,15 @@ void TextureSaveDialog::on_saveCancelButtons_accepted() QFileInfo fi(filename()); + if(!fi.isAbsolute()) + { + RDDialog::critical( + this, tr("Save Texture"), + tr("%1\nIs not an absolute path.\nCheck the path and try again.").arg(filename())); + + return; + } + QDir dir = fi.dir(); bool valid = dir.makeAbsolute();