diff options
| author | Carl Hetherington <cth@carlh.net> | 2023-02-17 21:27:28 +0100 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2023-02-17 21:27:28 +0100 |
| commit | 7c86201edcf2999561fb3efe3057cd913d0553ef (patch) | |
| tree | d266c9b9500fce62e22af17eb47d011746008129 /src | |
| parent | 17adeaa0351816cb56ef31ddee714627654a2b37 (diff) | |
Don't crash if the descriptor's sampling rate denominator is 0.
Diffstat (limited to 'src')
| -rw-r--r-- | src/sound_asset.cc | 2 |
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); |
