Possible bug in MPEG::File::strip

Kevin André hyperquantum at gmail.com
Tue Sep 13 15:57:48 UTC 2016


I think I found a problem in MPEG::File::strip, and I managed to
reproduce it with a new unit test (see patch attached).

What the test does:
  1) read the test MP3 file completely into a ByteVector
  2) copy the ByteVector into a new one, and call strip() on that
  3) copy the original ByteVector into another one, add some tags and
call save()
  4) copy the result from (3) into a new ByteVector, and call strip() on it
  5) check if the resulting ByteVectors from (2) and (4) have the same length

But the test fails...

1: test_mpeg.cpp:361:Assertion
1: Test name: TestMPEG::testStripAndFileLength
1: equality assertion failed
1: - Expected: 8208
1: - Actual  : 8336

The result of (4) is exactly 128 bytes larger than the result of (2).
And that is the size of an ID3v1 tag. So, is there something wrong
with the strip() method? Or did I miss something?

I looked at the implementation of the strip() method but couldn't
really find anything that might cause this. And both calls to strip()
seem to return true, though I did not include the checks for that in
the patch attached.


-------------- next part --------------
A non-text attachment was scrubbed...
Name: test_strip_filelength.patch
Type: application/octet-stream
Size: 2297 bytes
Desc: not available
URL: <http://mail.kde.org/pipermail/taglib-devel/attachments/20160913/7c208826/attachment.obj>

More information about the taglib-devel mailing list