Skip to content

Commit 4bf44f6

Browse files
Merge pull request #481 from wikimedia/upstream/shortfiles
ID3v1 should not parse files shorter than 128 bytes
2 parents edafafd + d721d36 commit 4bf44f6

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

getid3/module.tag.id3v1.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,9 @@ public function Analyze() {
2929
if (!getid3_lib::intValueSupported($info['filesize'])) {
3030
$this->warning('Unable to check for ID3v1 because file is larger than '.round(PHP_INT_MAX / 1073741824).'GB');
3131
return false;
32+
} elseif ($info['filesize'] < 128) {
33+
$this->warning('Unable to check for ID3v1 because file is too small');
34+
return false;
3235
}
3336

3437
if($info['filesize'] < 256) {

0 commit comments

Comments
 (0)