summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2023-02-17 21:27:28 +0100
committerCarl Hetherington <cth@carlh.net>2023-02-17 21:27:28 +0100
commit7c86201edcf2999561fb3efe3057cd913d0553ef (patch)
treed266c9b9500fce62e22af17eb47d011746008129 /src
parent17adeaa0351816cb56ef31ddee714627654a2b37 (diff)
Don't crash if the descriptor's sampling rate denominator is 0.
Diffstat (limited to 'src')
-rw-r--r--src/sound_asset.cc2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/sound_asset.cc b/src/sound_asset.cc
index 0eaa8fb5..e24aced2 100644
--- a/src/sound_asset.cc
+++ b/src/sound_asset.cc
@@ -78,7 +78,7 @@ SoundAsset::SoundAsset (boost::filesystem::path file)
boost::throw_exception (ReadError("could not read audio MXF information"));
}
- _sampling_rate = desc.AudioSamplingRate.Numerator / desc.AudioSamplingRate.Denominator;
+ _sampling_rate = desc.AudioSamplingRate.Denominator ? (desc.AudioSamplingRate.Numerator / desc.AudioSamplingRate.Denominator) : 0;
_channels = desc.ChannelCount;
_edit_rate = Fraction (desc.EditRate.Numerator, desc.EditRate.Denominator);