From 33ffe2cb6263345aa17f296719e7261e5f351525 Mon Sep 17 00:00:00 2001 From: s_falahati Date: Wed, 1 Nov 2017 21:18:09 +0330 Subject: [PATCH] removeFrame method now ignores the request if the calculated expected frames to remove is equal to zero --- src/MpegAudio.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/MpegAudio.php b/src/MpegAudio.php index c302f17..ec5ff42 100644 --- a/src/MpegAudio.php +++ b/src/MpegAudio.php @@ -398,7 +398,9 @@ public function removeFrame($index, $count = 1) { return $this; } $count = min($this->getFrameCounts() - $index, $count); - + if ($count == 0) { + return $this; + } $firstFrameHeader = $this->getFrameHeader($index); $lastFrameHeader = $this->getFrameHeader($index + ($count - 1)); $this->slice(($lastFrameHeader->getOffset() + $lastFrameHeader->getLength()) - $firstFrameHeader->getOffset(), $firstFrameHeader->getOffset());