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

Fix Error: Trying to access array offset on value of type bool (on li… #217

Merged
merged 1 commit into from
Dec 21, 2019

Conversation

ben-xo
Copy link
Contributor

@ben-xo ben-xo commented Dec 21, 2019

…ne 1791 of getID3/module.audio.mp3.php)

@JamesHeinrich
Copy link
Owner

Can you provide a sample file that would trigger MPEGaudioHeaderValid getting called with $rawarray not being an array?

@ben-xo
Copy link
Contributor Author

ben-xo commented Dec 21, 2019 via email

@JamesHeinrich
Copy link
Owner

The fact that it only happens on PHP 7.4 seems significant. I don't have ready access to a 7.4 test environment right at the moment, would you be able to trace through and see where/why/how MPEGaudioHeaderValid is getting called with $rawarray not being an array, and why that would happen on 7.4 but not earlier versions?

I don't want to simply mask the error when there may be a more significant problem lurking elsewhere.

@ben-xo
Copy link
Contributor Author

ben-xo commented Dec 21, 2019

I'll see what I can do.

@ben-xo
Copy link
Contributor Author

ben-xo commented Dec 21, 2019

This is the stack trace, right before it crashes

dir2cast.php (suspended at line breakpoint)	
	/Users/ben/Documents/workspace/dir2cast test/getID3/module.audio.mp3.php.getid3_mp3::MPEGaudioHeaderValid(): lineno 1791	
	/Users/ben/Documents/workspace/dir2cast test/getID3/module.audio-video.quicktime.php.getid3_quicktime->QuicktimeParseAtom(): lineno 1457	
	/Users/ben/Documents/workspace/dir2cast test/getID3/module.audio-video.quicktime.php.getid3_quicktime->Analyze(): lineno 74	
	/Users/ben/Documents/workspace/dir2cast test/getID3/getid3.php.getID3->analyze(): lineno 629	
	/Users/ben/Documents/workspace/dir2cast test/dir2cast.php.getID3_Podcast_Helper->appendToItem(): lineno 165	
	/Users/ben/Documents/workspace/dir2cast test/dir2cast.php.MP4_RSS_Item->appendToChannel(): lineno 420	
	/Users/ben/Documents/workspace/dir2cast test/dir2cast.php.Locking_Cached_Dir_Podcast->generate(): lineno 761	
	/Users/ben/Documents/workspace/dir2cast test/dir2cast.php.Locking_Cached_Dir_Podcast->generate(): lineno 1012	
	/Users/ben/Documents/workspace/dir2cast test/dir2cast.php.{main}(): lineno 1511	

at this point, MPEGaudioHeaderDecode is returning false - that code path is possible if $this->fread(4) returns fewer than 4 bytes.

@ben-xo
Copy link
Contributor Author

ben-xo commented Dec 21, 2019

Stepping through the code, the file pointer for the mp4 file is at the end of the file when this code is called, so that's why it returns less than 4 bytes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants