Skip to content

Commit eebdbea

Browse files
authored
The variable MUST be an integer. Test it and convert it if needed. (PHP-FFMpeg#350)
1 parent edf87d9 commit eebdbea

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/FFMpeg/Format/ProgressListener/AbstractProgressListener.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -179,6 +179,12 @@ private function parseProgress($progress)
179179

180180
if ($this->lastOutput !== null) {
181181
$delta = $currentTime - $this->lastOutput;
182+
183+
// Check the type of the currentSize variable and convert it to an integer if needed.
184+
if(!is_numeric($currentSize)) {
185+
$currentSize = (int)$currentSize;
186+
}
187+
182188
$deltaSize = $currentSize - $this->currentSize;
183189
$rate = $deltaSize * $delta;
184190
if ($rate > 0) {

0 commit comments

Comments
 (0)