Ver Fonte

Fixed String::humanize_size crash.

Close #35872

(cherry picked from commit ca0ee767cb5f93420b456fa47422ae2b3e266b4f)
dankan1890 há 5 anos atrás
pai
commit
7ccfbd61a4
1 ficheiros alterados com 1 adições e 1 exclusões
  1. 1 1
      core/ustring.cpp

+ 1 - 1
core/ustring.cpp

@@ -3324,7 +3324,7 @@ String String::humanize_size(uint64_t p_size) {
 
 	int prefix_idx = 0;
 
-	while (prefix_idx < prefixes.size() && p_size > (_div * 1024)) {
+	while (prefix_idx < prefixes.size() - 1 && p_size > (_div * 1024)) {
 		_div *= 1024;
 		prefix_idx++;
 	}