Fix off-by-one in ASSERT and make it more comprehensive.
authorCarl Hetherington <cth@carlh.net>
Sun, 26 Jul 2020 00:26:42 +0000 (02:26 +0200)
committerCarl Hetherington <cth@carlh.net>
Sun, 26 Jul 2020 19:30:53 +0000 (21:30 +0200)
src/lib/cinema_sound_processor.cc

index 1a3ba5a0f0af61fcd9b9d412a4b6111e4ffc82ca..bd60f7d710e2acef17813225baa62fe8a09e7d4d 100644 (file)
@@ -107,7 +107,7 @@ CinemaSoundProcessor::as_index (CinemaSoundProcessor const * s)
 CinemaSoundProcessor const *
 CinemaSoundProcessor::from_index (int i)
 {
-       DCPOMATIC_ASSERT (i <= int(_cinema_sound_processors.size ()));
+       DCPOMATIC_ASSERT (i >= 0 && i < int(_cinema_sound_processors.size()));
        return _cinema_sound_processors[i];
 }