Closed GoogleCodeExporter closed 9 years ago
first 1.5MB of the file in question
also fails with trunk
Original comment by reiter.christoph@gmail.com
on 7 Feb 2012 at 10:37
Attachments:
There are lots of places where fileobj.read(x) isn't checked or will silently
fail (to_int_be) and lead to even more corrupt files after saving (StreamInfo
for example)
What about wrapping the fileobj and raise if the read size doesn't match?
Original comment by reiter.christoph@gmail.com
on 21 Feb 2012 at 12:45
That seems like a reasonable approach.
Original comment by joe.wreschnig@gmail.com
on 21 Feb 2012 at 1:56
Last block has zero size but includes the valid picture block if the size is
ignored.
Offending software (according to the blocsonic guy): Amadeus Pro
http://www.hairersoft.com/pro.html
original: gstreamer fails, vlc works but no image, easytag shows tags/image
save with writing back invalid block: gstreamer fails, vlc still works, easytag
shows only tags
save with ignoring size: gstreamer ok, vlc ok, easytag shows tags/image
So I would suggest to ignore the size for all blocks that have their own size
info. Writing back the invalid blocks leaves 1MB of image garbage in there and
as can be seen above at least gstreamer doesn't find the audio header, others
that work with the original file might fail after that as well.
Original comment by reiter.christoph@gmail.com
on 22 Feb 2012 at 12:59
- wrap the file object and check returned read size
- add _distrust_size attribute to MetadataBlock (True for Picture and VCFLACDict) and leave reading to the block if True.
because I didn't write it above: metaflac/libflac also ignores the block size
for the Picture block.
tests:
- 106-short-picture-block-size.flac
zero size picture block with valid picture
- 106-invalid-streaminfo.flac
too short stream info block (missing the checksum), to test read check
Original comment by reiter.christoph@gmail.com
on 9 Apr 2012 at 4:41
Attachments:
This issue was closed by revision r124.
Original comment by reiter.christoph@gmail.com
on 25 Jul 2012 at 11:42
Commited: The above patch unchanged but split up in object-wrapper and
picture-block part.
Original comment by reiter.christoph@gmail.com
on 25 Jul 2012 at 11:44
Original issue reported on code.google.com by
themineo
on 7 Feb 2012 at 9:40