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 an error when scanning WAV file via an externally opened file pointer #298

Merged
merged 1 commit into from
Mar 13, 2021

Conversation

paulijar
Copy link
Contributor

The problem fixed by this PR is similar to the one reported earlier in #242. The problem was fixed for MP3 and several other file types in 276fd3e but the WAV files were missed at that time. Since then, also support for DSDIFF files has been added with the same problem.

To recap, the problem case is when the file being analyzed is passed to getID3 as a file pointer without giving a fully qualified file path. When the file type specific module then spawns a secondary instance of getID3, it has to pass it also the filesize given by the client application. If null is passed as filesize to getID3::openfile, then it tries to obtain the filesize from the system using the filename. But this will fail if the filename is not fully qualified.

For the very least, the failing attempt to read the file size causes an error message like Error: filesize(): stat failed for /username/path/to/song/17 Chanson d'Automne.wav at /var/www/nextcloud/apps/music/3rdparty/getID3/getid3/getid3.php#468 to be logged. But probably it may cause also more severe issues, depending on the used PHP and/or server configuration.

Here is a related application issue: owncloud/music#837

The fixed problem is similar to the one reported earlier in
JamesHeinrich#242. The problem was
fixed for MP3 and several other file types in 276fd3e but the WAV
files were missed at that time. Since then, also support for DSDIFF
files has been added with the same problem.

To recap, the problem case is when the file being analyzed is passed
to getID3 as a file pointer without giving a fully qualified file path.
When the file type specific module then spawns a secondary instance of
getID3, it has to pass it also the filesize given by the client
application. If null is passed as filesize to getID3::openfile, then it
tries to obtain the filesize from the system using the filename. But
this will fail if the filename is not fully qualified.
@JamesHeinrich JamesHeinrich merged commit a309234 into JamesHeinrich:master Mar 13, 2021
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