Catch bad calls to ::get().
authorCarl Hetherington <cth@carlh.net>
Mon, 30 Nov 2015 11:52:00 +0000 (11:52 +0000)
committerCarl Hetherington <cth@carlh.net>
Mon, 30 Nov 2015 11:52:00 +0000 (11:52 +0000)
src/lib/audio_mapping.cc

index 4e2e29363516f6a8b1bcb52772799de022ee0e32..906e79bd89b089a777d8c727fd42c886f066c69a 100644 (file)
@@ -119,6 +119,8 @@ AudioMapping::set (int input_channel, int output_channel, float g)
 float
 AudioMapping::get (int input_channel, int output_channel) const
 {
+       DCPOMATIC_ASSERT (input_channel < int (_gain.size()));
+       DCPOMATIC_ASSERT (output_channel < int (_gain[0].size()));
        return _gain[input_channel][output_channel];
 }