diff --git a/libraries/AP_Mount/AP_Mount_Topotek.cpp b/libraries/AP_Mount/AP_Mount_Topotek.cpp index 9487e202af65ff..3aa8f43c05ca6d 100755 --- a/libraries/AP_Mount/AP_Mount_Topotek.cpp +++ b/libraries/AP_Mount/AP_Mount_Topotek.cpp @@ -1076,6 +1076,9 @@ void AP_Mount_Topotek::gimbal_version_analyse() version[ver_count++] = ver_num; ver_num = 0; } + if (ver_count >= ARRAY_SIZE(version)) { + break; + } } } else { if (data_buf_len >= 1) {