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

Musepack V8: "Invalid SH packet size" #198

Closed
lazka opened this issue Oct 22, 2014 · 2 comments
Closed

Musepack V8: "Invalid SH packet size" #198

lazka opened this issue Oct 22, 2014 · 2 comments
Labels
bug

Comments

@lazka
Copy link
Member

@lazka lazka commented Oct 22, 2014

Originally reported by: Philipp Wolfer (Bitbucket: phwolfer, GitHub: Unknown)


Mutagen 1.25.1 produces an "Invalid SH packet size" for some Musepack files. E.g. the ones available on https://forum.musepack.net/showthread.php?t=654

I just encoded another FLAC file to Musepack and that worked, so it's only certain files that are affected. Stack trace for the error:

#!
File "/usr/lib/python2.7/site-packages/mutagen/_file.py", line 38, in __init__
    self.load(filename, *args, **kwargs)
File "/usr/lib/python2.7/site-packages/mutagen/apev2.py", line 693, in load
    self.info = self._Info(open(filename, "rb"))
File "/usr/lib/python2.7/site-packages/mutagen/musepack.py", line 108, in __init__
    self.__parse_sv8(fileobj)
File "/usr/lib/python2.7/site-packages/mutagen/musepack.py", line 139, in __parse_sv8
    self.__parse_stream_header(fileobj, data_size)
File "/usr/lib/python2.7/site-packages/mutagen/musepack.py", line 170, in __parse_stream_header
    raise MusepackHeaderError("Invalid SH packet size.")
MusepackHeaderError: Invalid SH packet size.

@lazka

This comment has been minimized.

Copy link
Member Author

@lazka lazka commented Oct 24, 2014

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


Thanks. Looking at the code in mpcenc.c it seems the SH packet size can be larger than the content in case the source wave file is smaller than specified in its header. So mutagen needs to be less strict here and ignore packet sizes.

@lazka

This comment has been minimized.

Copy link
Member Author

@lazka lazka commented Oct 28, 2014

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


musepack: support padded SH packets. (Fixes issue #198)

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.