Skip to content

Commit 7aec0d4

Browse files
committed
bugfix #2514: FLAC zero-byte block header
https://www.getid3.org/phpBB3/viewtopic.php?t=2514
1 parent dd1099b commit 7aec0d4

File tree

3 files changed

+36
-2
lines changed

3 files changed

+36
-2
lines changed

changelog.txt

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,35 @@
1818
Version History
1919
===============
2020

21+
1.9.16: [2018-10-17] James Heinrich :: 1.9.16-201810171314
22+
* bugfix (G:168) Ogg FLAC not parsed
23+
* bugfix (G:163) invalid MP3 header error on VBR
24+
* bugfix (G:162) prevent writing multiple ID3v2 versions
25+
* bugfix (G:161) MP3 VBR header duration
26+
* bugfix (G:160) OggOpus duration sometimes incorrect
27+
* bugfix (G:157) quicktime GPS invalid argument
28+
* bugfix (G:148) MPEG-2 aspect ratio
29+
* bugfix (G:147) Quicktime fourcc codec name lookup
30+
* bugfix (G:147) Quicktime audio/video bitrate guessing
31+
* bugfix (G:145) incompatible variable types
32+
* bugfix (G:139) Quicktime islt subatoms >5
33+
* bugfix (G:137) ID3v2 semi-numeric genres
34+
* bugfix (G:136) ID3v2 unsynchronised typo
35+
* bugfix (#2514) FLAC zero-byte block header
36+
* bugfix (#2488) MIME types (FLAC, WAV, gzip)
37+
* bugfix (#2468) Quicktime video rotation
38+
* bugfix (#2207) metaflac + attached pictures
39+
* bugfix (#2151) improved demo UNC filename support
40+
* bugfix (#1966) fread fail when PHP memory_limit -1
41+
* bugfix (#1908) Quicktime rotation detection (using matrix values)
42+
* bugfix (#1908) Quicktime "rcif" and "dscp" atoms
43+
* bugfix (#1900) demo.joinmp3 cut from end
44+
* security: avoid disabled demo reflection
45+
* TIFF: expand list of named tags, expose as 'tag_name' key for all entries
46+
* Quicktime: parse some GoPro-specific data
47+
* helperapps (Windows): updated vorbiscomment.exe, metaflac.exe to v1.3.2
48+
* add more image formats supported by getimagesize()
49+
2150
1.9.15: [2017-10-26] James Heinrich :: 1.9.15-201709291043
2251
» (G:108) add basic APNG support
2352
» (G:107) add basic WebP support

getid3/getid3.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -251,7 +251,7 @@ class getID3
251251
*/
252252
protected $startup_warning = '';
253253

254-
const VERSION = '1.9.15-201809221240';
254+
const VERSION = '1.9.16-201810171314';
255255
const FREAD_BUFFER_SIZE = 32768;
256256

257257
const ATTACHMENTS_NONE = false;

getid3/module.audio.flac.php

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ public function parseMETAdata() {
5252
do {
5353
$BlockOffset = $this->ftell();
5454
$BlockHeader = $this->fread(4);
55-
$LBFBT = getid3_lib::BigEndian2Int(substr($BlockHeader, 0, 1));
55+
$LBFBT = getid3_lib::BigEndian2Int(substr($BlockHeader, 0, 1)); // LBFBT = LastBlockFlag + BlockType
5656
$LastBlockFlag = (bool) ($LBFBT & 0x80);
5757
$BlockType = ($LBFBT & 0x7F);
5858
$BlockLength = getid3_lib::BigEndian2Int(substr($BlockHeader, 1, 3));
@@ -63,6 +63,11 @@ public function parseMETAdata() {
6363
break;
6464
}
6565
if ($BlockLength < 1) {
66+
if ($BlockTypeText != 'reserved') {
67+
// probably supposed to be zero-length
68+
$this->warning('METADATA_BLOCK_HEADER.BLOCK_LENGTH ('.$BlockTypeText.') at offset '.$BlockOffset.' is zero bytes');
69+
continue;
70+
}
6671
$this->error('METADATA_BLOCK_HEADER.BLOCK_LENGTH ('.$BlockLength.') at offset '.$BlockOffset.' is invalid');
6772
break;
6873
}

0 commit comments

Comments
 (0)