Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PHP 8.1: getid3_quicktime::QuicktimeParseContainerAtom(): fix deprecation notice #337

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 8 additions & 3 deletions getid3/module.audio-video.quicktime.php
Original file line number Diff line number Diff line change
Expand Up @@ -2093,7 +2093,7 @@ public function QuicktimeParseAtom($atomname, $atomsize, $atom_data, $baseoffset
* @return array|false
*/
public function QuicktimeParseContainerAtom($atom_data, $baseoffset, &$atomHierarchy, $ParseAllPossibleAtoms) {
$atom_structure = false;
$atom_structure = array();
$subatomoffset = 0;
$subatomcounter = 0;
if ((strlen($atom_data) == 4) && (getid3_lib::BigEndian2Int($atom_data) == 0x00000000)) {
Expand All @@ -2111,17 +2111,22 @@ public function QuicktimeParseContainerAtom($atom_data, $baseoffset, &$atomHiera
$subatomoffset += 4;
continue;
}
return $atom_structure;
break;
}
if (strlen($subatomdata) < ($subatomsize - 8)) {
// we don't have enough data to decode the subatom.
// this may be because we are refusing to parse large subatoms, or it may be because this atom had its size set too large
// so we passed in the start of a following atom incorrectly?
return $atom_structure;
break;
}
$atom_structure[$subatomcounter++] = $this->QuicktimeParseAtom($subatomname, $subatomsize, $subatomdata, $baseoffset + $subatomoffset, $atomHierarchy, $ParseAllPossibleAtoms);
$subatomoffset += $subatomsize;
}

if (empty($atom_structure)) {
return false;
}

return $atom_structure;
}

Expand Down