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

scipy.io.wavfile.read fails silently on files > 2**32 bytes #9772

Open
pletnes opened this issue Feb 6, 2019 · 1 comment
Open

scipy.io.wavfile.read fails silently on files > 2**32 bytes #9772

pletnes opened this issue Feb 6, 2019 · 1 comment
Labels

Comments

@pletnes
Copy link

pletnes commented Feb 6, 2019

I noticed that scipy.io.wavfile.read will happily read a wavefile larger than 2**32 bytes, even though these files are not supported by the standard. However, scipy seems to read the filesize % 2**32 first bytes.

Reproducing code example:

# if `filename` corresponds to a large file, this does not crash but returns partial data
fs, wavedata = scipy.io.wavfile.read(filename)

Question: should this raise e.g. an IOError('wavefile too large') or similar?

Scipy/Numpy/Python version information:

import sys, scipy, numpy; print(scipy.__version__, numpy.__version__, sys.version_info)
# 1.2.0 1.15.4 sys.version_info(major=3, minor=6, micro=8, releaselevel='final', serial=0)
@sethtroisi
Copy link
Contributor

sethtroisi commented May 21, 2020

Makes senses from the code

I suspect that the header gets the lower bytes of filesize and we respect that when we read.
It's possible we could check the size of the file and read the whole file (especially if it's 2^32 + header size)

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

No branches or pull requests

3 participants