SMOTE does an out-of-bounds read if the number of neighbors to use is higher than the number of input samples:
then:
Use fewer neighbors in that case.
Untested because I currently can't compile OTB (#2409, #2410, #2411).