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

MP3: Fails to load files that are too small #72

Closed
lazka opened this issue Jul 4, 2014 · 2 comments
Closed

MP3: Fails to load files that are too small #72

lazka opened this issue Jul 4, 2014 · 2 comments
Labels

Comments

@lazka
Copy link
Member

@lazka lazka commented Jul 4, 2014

Originally reported by: Christoph Reiter (Bitbucket: lazka, GitHub: lazka)


From Ms.Shap...@gmail.com on September 21, 2010 16:40:02

This is with mutagen 1.15-2 (as found in Ubuntu Lucid repository)

>>> from mutagen.mp3 import MP3
>>> MP3("Track 10.mp3")
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/lib/python2.6/dist-packages/mutagen/__init__.py", line 73, in __init__
    self.load(filename, *args, **kwargs)
  File "/usr/lib/python2.6/dist-packages/mutagen/id3.py", line 1957, in load
    self.info = self._Info(fileobj, offset)
  File "/usr/lib/python2.6/dist-packages/mutagen/mp3.py", line 95, in __init__
    try: self.__try(fileobj, int(i), size - offset)
  File "/usr/lib/python2.6/dist-packages/mutagen/mp3.py", line 166, in __try
    frame_data = struct.unpack(">H", data[possible:possible + 2])[0]
struct.error: unpack requires a string argument of length 2
>>> 

I have noticed that for this file at the time the exception is thrown, len(data) == possible. 

I have my own workaround however I do not want to publish it because I haven't taken the time to understand the code that surrounds it.  

I have attached the file for your convenience.

Attachment: 10 - Track 10.mp3

Original issue: http://code.google.com/p/mutagen/issues/detail?id=72


@lazka

This comment has been minimized.

Copy link
Member Author

@lazka lazka commented Jul 4, 2014

Original comment by Christoph Reiter (Bitbucket: lazka, GitHub: lazka):


From joe.wreschnig@gmail.com on October 27, 2010 05:51:31

https://code.google.com/p/mutagen/source/detail?r=95

Status: Fixed

@lazka

This comment has been minimized.

Copy link
Member Author

@lazka lazka commented Jul 4, 2014

Original comment by Christoph Reiter (Bitbucket: lazka, GitHub: lazka):


From joe.wreschnig@gmail.com on October 27, 2010 05:50:04

Summary: MP3: Fails to load files that are too small

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
1 participant
You can’t perform that action at this time.