GrandOrgue / grandorgue

GrandOrgue software
Other
149 stars 39 forks source link

Fixed crash on enabling convolution reverb https://github.com/GrandOrgue/grandorgue/issues/1741 #1743

Closed oleg68 closed 6 months ago

oleg68 commented 6 months ago

It is the first PR related to #1741

The reason of the crash was that:

  1. the impulse response file name field contained a directory name instead of a file name.
  2. In this case m_File.Length() of the directory returned a negative value that was converted to a huge unsigned value.
  3. An attempt to allocate memory of this size caused an Out Of Memory exception

This PR fixes crash when the field contains a directory name instead of the file name.

Fixing appearance of the directory name in this field by default will be a subject of a next PR.