Explorar o código

Merge pull request #46652 from akien-mga/remote-debugger-fix-div-by-zero

RemoteDebugger: Fix possible division by zero
Rémi Verschelde %!s(int64=4) %!d(string=hai) anos
pai
achega
4c10d31bc4
Modificáronse 1 ficheiros con 1 adicións e 0 borrados
  1. 1 0
      core/debugger/remote_debugger.cpp

+ 1 - 0
core/debugger/remote_debugger.cpp

@@ -76,6 +76,7 @@ public:
 	NetworkProfiler() {}
 
 	int bandwidth_usage(const Vector<BandwidthFrame> &p_buffer, int p_pointer) {
+		ERR_FAIL_COND_V(p_buffer.size() == 0, 0);
 		int total_bandwidth = 0;
 
 		uint32_t timestamp = OS::get_singleton()->get_ticks_msec();