UtkarshShrivastava / mp4parser

Automatically exported from code.google.com/p/mp4parser
0 stars 0 forks source link

iTunes produced small file fails with Reconstructed Size is not equal to the number of parsed bytes!"" #30

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
I'm trying to use mp4parser to implement a MP4 parser for Apache Tika

As part of that, I've created a small test M4A MP4 audio file using iTunes, 
which is based on a very short wav file and some test metadata. The test file 
is only 5kb large, and is available from 
http://svn.apache.org/repos/asf/tika/trunk/tika-parsers/src/test/resources/test-
documents/testMP4.m4a

When trying to load this file in mp4parser when asserts are enabled (such as in 
the Tika test suite), the parser blows up with:

Reconstructed Size is not equal to the number of parsed bytes! (hdlr) Actual 
Box size: 34 Calculated size: 36 at offset: 617

Looking at a hex dump of the file, the size is 0x22, and that looks correct to 
me as at 0x028b we have 00 00 03 a6 ilst, which appears to be a 0x03a6 long 
ilst box:

00000260  fb 6d 65 74 61 00 00 00  00 00 00 00 22 68 64 6c  |.meta......."hdl|
00000270  72 00 00 00 00 00 00 00  00 6d 64 69 72 61 70 70  |r........mdirapp|
00000280  6c 00 00 00 00 00 00 00  00 00 cc 00 00 03 a6 69  |l..............i|
00000290  6c 73 74 00 00 00 22 a9  6e 61 6d 00 00 00 1a 64  |lst...".nam....d|

The file was created with iTunes (which has no problems with it), and both 
mplayer and ffmpeg are happy with it too, so this looks like a mp4parser bug

Original issue reported on code.google.com by n...@apache.org on 28 Jan 2012 at 9:12

GoogleCodeExporter commented 9 years ago
attached a patch to https://issues.apache.org/jira/browse/TIKA-852

Original comment by Sebastian.Annies on 31 Mar 2012 at 3:51