Skip to content

Commit

Permalink
[media] Fix dereferencing of empty optional if the sound file is missing
Browse files Browse the repository at this point in the history
  • Loading branch information
jcelerier committed Feb 24, 2023
1 parent 1e854f9 commit dba6f5d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/plugins/score-plugin-media/Media/MediaFileHandle.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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;
Expand Down

0 comments on commit dba6f5d

Please sign in to comment.