diff --git a/src/core/SampleBuffer.cpp b/src/core/SampleBuffer.cpp index c96111bba..f583067f8 100644 --- a/src/core/SampleBuffer.cpp +++ b/src/core/SampleBuffer.cpp @@ -305,10 +305,6 @@ void SampleBuffer::update(bool keepSettings) } sf_close(sndFile); } - else - { - fileLoadError = FileLoadError::Invalid; - } f.close(); } @@ -337,6 +333,11 @@ void SampleBuffer::update(bool keepSettings) { m_frames = decodeSampleDS(file, buf, channels, samplerate); } + + if (m_frames == 0) + { + fileLoadError = FileLoadError::Invalid; + } } if (m_frames == 0 || fileLoadError != FileLoadError::None) // if still no frames, bail