vilya / Shadertron

Run, record and edit ShaderToy shaders without a web browser or internet connection.
13 stars 1 forks source link

Crash when a resource is missing #41

Closed vilya closed 5 years ago

vilya commented 5 years ago

If one or more inputs refer to a video or sound file which doesn't exist, the program crashes. It should not crash, it should report an error instead (which can be displayed in the UI, as per issue #23)

vilya commented 5 years ago

The problem seems to have been caused by using an absolute filename on Windows which:

  1. Includes the drive letter; and
  2. Uses forward slashes rather than backslashes

In this case, because the filename starts with e.g. c:/ Qt mis-identifies it as a URL with scheme = "c" rather than a filename. I think Qt does a file-exists check before parsing it as a URL, which is why this only comes up when the file doesn't exist.

The problem seems to be fixed in Qt 5.13 alpha, but it means that loading silently fails (the error signal never gets sent by the player), so we do still need to handle it explicitly.