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

Incorrect length passed to fread on a flac file #351

Closed
paulijar opened this issue Nov 20, 2021 · 1 comment
Closed

Incorrect length passed to fread on a flac file #351

paulijar opened this issue Nov 20, 2021 · 1 comment

Comments

@paulijar
Copy link
Contributor

I got a sample file from a user which causes an error when being analyzed with getID3. The user reported that this causes a segmentation fault, while I can only see an error being logged but the analysis finishes otherwise fine. My best guess is that maybe the user is using PHP 8 while I have been testing on PHP 7.4.

The relevant part of the stack trace is this:

ValueError: fread(): Argument #2 ($length) must be greater than 0 in /var/www/html/nextcloud/apps/music/3rdparty/getID3/getid3/getid3.php:2215
Stack trace:
#0 /var/www/html/nextcloud/apps/music/3rdparty/getID3/getid3/getid3.php(2215): fread()
#1 /var/www/html/nextcloud/apps/music/3rdparty/getID3/getid3/module.audio.flac.php(408): getid3_handler->fread()
#2 /var/www/html/nextcloud/apps/music/3rdparty/getID3/getid3/module.audio.flac.php(125): getid3_flac->parsePICTURE()
#3 /var/www/html/nextcloud/apps/music/3rdparty/getID3/getid3/module.audio.flac.php(46): getid3_flac->parseMETAdata()
#4 /var/www/html/nextcloud/apps/music/3rdparty/getID3/getid3/getid3.php(778): getid3_flac->Analyze()
#5 /var/www/html/nextcloud/apps/music/lib/Utility/ExtractorGetID3.php(75): getID3->analyze()

I shall email the sample file shortly.

JamesHeinrich added a commit that referenced this issue Nov 20, 2021
Prevent warning (PHP7) or crash (PHP8) when fread asked to read zero bytes
@JamesHeinrich
Copy link
Owner

Fixed in 6f7b917

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

No branches or pull requests

2 participants