[proxy] github.com← back | site home | direct (HTTPS) ↗ | proxy home | ◑ dark◐ light
/ cpython Public

Conversation

Copy link

BT123 commented Nov 17, 2017

I found a bug in wave.py because there is no check for self._channel in fmt reading function.
When I try to open a wav file which channel is zero, it will crash bacause of divided by zero in initfp function.

Copy link

Hello, and thanks for your contribution!

I'm a bot set up to make sure that the project can legally accept your contribution by verifying you have signed the PSF contributor agreement (CLA).

Unfortunately we couldn't find an account corresponding to your GitHub username on bugs.python.org (b.p.o) to verify you have signed the CLA (this might be simply due to a missing "GitHub Name" entry in your b.p.o account settings). This is necessary for legal reasons before we can look at your contribution. Please follow the steps outlined in the CPython devguide to rectify this issue.

Thanks again to your contribution and we look forward to looking at it!

self._sampwidth = (sampwidth + 7) // 8
else:
raise Error('unknown format: %r' % (wFormatTag,))
if self._channels == 0:
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If I am not mistaken, then this attribute was called _nchannels in previous versions of Python, i.e. 3.4.x. It might be a good idea to use the getnchannels() method to access this information instead, which abstracts the concrete name. This has the advantage of making this patch applicable to previous versions of Python, too.

Copy link
Member

This PR has been superseded by the discussion in bpo-32056 where it was decided to not try to address this a bug in 3.6.

ned-deily closed this Mar 23, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants