[BH-2019] Fix crash after deleting WAV alarm sound

Fix of the issue that the device would crash
when entering alarm sound selection list
after deleting selected file during alarm
ringing, but only when file's format was
WAV.
This commit is contained in:
Lefucjusz
2024-06-27 10:52:10 +02:00
committed by Marcin Łyda
parent c65b507ba1
commit 67a24efb29

View File

@@ -15,6 +15,10 @@ namespace audio
{
DecoderWAV::DecoderWAV(const std::string &filePath) : Decoder(filePath), wav(std::make_unique<drwav>())
{
if (fileSize == 0) {
return;
}
if (drwav_init(wav.get(), drwavRead, drwavSeek, this, nullptr) == DRWAV_FALSE) {
LOG_ERROR("Unable to init WAV decoder");
return;