From dba6f5ded572def7069cf49900fc94d23cdb38fc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jean-Micha=C3=ABl=20Celerier?= Date: Fri, 24 Feb 2023 14:30:48 -0500 Subject: [PATCH] [media] Fix dereferencing of empty optional if the sound file is missing --- src/plugins/score-plugin-media/Media/MediaFileHandle.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/plugins/score-plugin-media/Media/MediaFileHandle.cpp b/src/plugins/score-plugin-media/Media/MediaFileHandle.cpp index 890043cde6..46d4206d15 100644 --- a/src/plugins/score-plugin-media/Media/MediaFileHandle.cpp +++ b/src/plugins/score-plugin-media/Media/MediaFileHandle.cpp @@ -40,7 +40,7 @@ static DecodingMethod needsDecoding(const QString& path, int rate) { const auto& info = probe(path); - if(info->fileRate == rate) + if(info && info->fileRate == rate) return DecodingMethod::Mmap; else return DecodingMethod::Libav; @@ -50,7 +50,7 @@ static DecodingMethod needsDecoding(const QString& path, int rate) || path.endsWith("aif", Qt::CaseInsensitive)) { const auto& info = probe(path); - if(info->fileRate == rate) + if(info && info->fileRate == rate) return DecodingMethod::Sndfile; else return DecodingMethod::Libav;