Throw std::out_of_range when out of frames