X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Flibr2c2%2Fspeedquantizer.cpp;h=f2b14b8a2aa8d6f6d585562739f8c111d548d787;hb=d0881a98a6240758ac1aeceaa9443d718ab1ad5c;hp=fa7a4be8b31311d348118cb47c4237e0e59ae8c7;hpb=850c1d571f2d2d157a873b678d86e4a5c771ba26;p=r2c2.git diff --git a/source/libr2c2/speedquantizer.cpp b/source/libr2c2/speedquantizer.cpp index fa7a4be..f2b14b8 100644 --- a/source/libr2c2/speedquantizer.cpp +++ b/source/libr2c2/speedquantizer.cpp @@ -22,6 +22,8 @@ void SpeedQuantizer::learn(unsigned i, float s, float w) float SpeedQuantizer::get_speed(unsigned i) const { + if(i>=steps.size()) + throw out_of_range("SpeedQuantizer::get_speed"); if(i==0) return 0; if(steps[i].weight>=weight_limit)