-
Notifications
You must be signed in to change notification settings - Fork 62
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
Skip padding data #31
Conversation
Padding could be added in box inside stbl in some contents.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this described in a spec anywhere? I confirmed that stagefright skips everywhere this commit adds skip, but I didn't verify that was all the boxes where it does.
What about tests? Verifying this is especially important for undocumented parsing requirements.
let to_skip = b.bytes_left(); | ||
try!(skip(&mut b, to_skip)); | ||
SampleEntry::Unknown | ||
{ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I assume the extra indent so iter
releases it's reference to src for the subsequent skip? I don't see an alternate solution besides moving this code into a read_description
helper function. That might not be a bad idea for readability anyway.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, it releases the borrow for the following skip.
} | ||
} | ||
|
||
// Padding could be added in some contents. | ||
try!(skip_box_remain(src)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This will skip additional entries where description_count
is short. That's probably fine.
Test failure seems to be an infrastructure problem. I'll go ahead and merge; please file new PRs for followup issues. |
I'll add test at another PR. I can't find any statement about the extra padding in 14496-12; however, there are 'free' and 'skip' box defined in spec. I think it should be a special case. |
Ok, thanks. |
I check the bitstream again. These paddings are 'skip' boxes actually. stsd box stsc box stsz box I don't think it is correct behaviour because 'stsd' is not a container box. My dump tool MP4Box can't parse this kind of content correctly neither. There are 2 ways in my mind currently.
Any idea? |
Hmm. I think this is just broken software. These ( Do we need to do more than we did with this PR? Skipping to the end of these boxes, regardless of the contents seems safer than trying to interpret them, when we want compatibility with what stagefright accepts. |
Ok, we don't need to do anything for these contents. I'll submit another PR for test later. |
This is from https://bugzilla.mozilla.org/show_bug.cgi?id=1306236.
Some contents may have extra padding data in the boxes of stbl. For example, stsc, stsz, stsd...etc.
This patch skips these paddings so parser keeps parsing the file.