Skip to content

Commit edccd92

Browse files
committed
chore(mp3info): apply upstream patch for parsing on short frames
Signed-off-by: grnd-alt <github@belakkaf.net>
1 parent f5e230b commit edccd92

File tree

5 files changed

+42
-3
lines changed

5 files changed

+42
-3
lines changed
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
diff --git a/wapmorgan/mp3info/src/Mp3Info.php b/wapmorgan/mp3info/src/Mp3Info.php
2+
index 17e40747..af034001 100644
3+
--- a/wapmorgan/mp3info/src/Mp3Info.php
4+
+++ b/wapmorgan/mp3info/src/Mp3Info.php
5+
@@ -232,7 +232,7 @@ class Mp3Info {
6+
$mode = $parseTags ? self::META | self::TAGS : self::META;
7+
$this->audioSize = $this->parseAudio($this->_fileName, $this->_fileSize, $mode);
8+
}
9+
-
10+
+
11+
12+
/**
13+
* @return bool|null|string
14+
@@ -585,6 +585,11 @@ class Mp3Info {
15+
$raw = fread($fp, 10);
16+
$frame_id = substr($raw, 0, 4);
17+
18+
+ if (strlen($raw) < 10) {
19+
+ fseek($fp, $lastByte);
20+
+ break;
21+
+ }
22+
+
23+
if ($frame_id == str_repeat(chr(0), 4)) {
24+
fseek($fp, $lastByte);
25+
break;

composer.patches.json

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
11
{
2-
"patches": {}
2+
"patches": {
3+
"wapmorgan/mp3info": {
4+
"Break frame parsing on invalid frame": ".patches/mp3info-break-frame-parsing.patch"
5+
}
6+
}
37
}

composer/installed.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6190,6 +6190,9 @@
61906190
"bin/mp3scan"
61916191
],
61926192
"type": "library",
6193+
"extra": {
6194+
"patches_applied": []
6195+
},
61936196
"installation-source": "dist",
61946197
"autoload": {
61956198
"psr-4": {
@@ -6395,6 +6398,6 @@
63956398
"install-path": "../web-auth/webauthn-lib"
63966399
}
63976400
],
6398-
"dev": false,
6401+
"dev": true,
63996402
"dev-package-names": []
64006403
}

composer/installed.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
'type' => 'library',
88
'install_path' => __DIR__ . '/../',
99
'aliases' => array(),
10-
'dev' => false,
10+
'dev' => true,
1111
),
1212
'versions' => array(
1313
'aws/aws-crt-php' => array(

wapmorgan/mp3info/PATCHES.txt

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
This file was automatically generated by Composer Patches (https://github.com/cweagans/composer-patches)
2+
Patches applied to this directory:
3+
4+
Break frame parsing on invalid frame
5+
Source: .patches/mp3info-break-frame-parsing.patch
6+
7+

0 commit comments

Comments
 (0)