Closed
Bug 1235427
Opened 9 years ago
Closed 9 years ago
MoofParser in libstagefright incorrectly reads base data offset from tfhd box
Categories
(Core :: Audio/Video: Playback, defect, P2)
Tracking
()
RESOLVED
FIXED
mozilla47
People
(Reporter: rudolfs.bundulis, Assigned: jya)
Details
Attachments
(3 files, 2 obsolete files)
2.44 MB,
video/mp4
|
Details | |
2.44 MB,
video/mp4
|
Details | |
1.53 KB,
patch
|
jya
:
review+
Sylvestre
:
approval-mozilla-aurora+
Sylvestre
:
approval-mozilla-beta+
|
Details | Diff | Splinter Review |
User Agent: Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/47.0.2526.106 Safari/537.36
Steps to reproduce:
Try playing a valid fragmented MP4 file via media source extensions (the file frag_ff.mp4 is attached). The file plays fine with VLC and ffplay.
Actual results:
The source buffer object raised an error event.
Expected results:
The file should have been played back.
I build the nightly Firefox from sources and tried to find the issue and it seems that the Tfhd::Tfhd() constructor in media/libstagefright/binding/MoofParser.cpp:682 has an error. It assumes base_data_offset will have a size of 4 bytes and will be written before the track_id field. However if we look at the ISO/IEC 14496-12:2005 specification it states:
aligned(8) class TrackFragmentHeaderBox
extends FullBox(‘tfhd’, 0, tf_flags){
unsigned int(32) track_ID;
// all the following are optional fields
unsigned int(64) base_data_offset;
unsigned int(32) sample_description_index;
unsigned int(32) default_sample_duration;
unsigned int(32) default_sample_size;
unsigned int(32) default_sample_flags
}
Thus the track_id comes before base_data_offset and base_data_offset is 8 bytes not 4 bytes long.
Reporter | ||
Comment 1•9 years ago
|
||
Updated version of the mp4 file - the previous did not contain a valid width height in the trak box.
Attachment #8702343 -
Attachment is obsolete: true
Reporter | ||
Comment 2•9 years ago
|
||
Reporter | ||
Comment 3•9 years ago
|
||
So we came down to the conclusion that the provided path works with fragmented mp4 that use the base_data_offset, but fragmented mp4 files with moof relative addressing seem to work out of the box.
Reporter | ||
Comment 4•9 years ago
|
||
Updated•9 years ago
|
Attachment #8702544 -
Flags: review?(giles)
Updated•9 years ago
|
Priority: -- → P2
Assignee | ||
Updated•9 years ago
|
Flags: needinfo?(jyavenard)
Assignee | ||
Updated•9 years ago
|
Assignee: nobody → jyavenard
Flags: needinfo?(jyavenard)
Assignee | ||
Comment 5•9 years ago
|
||
Comment on attachment 8702544 [details] [diff] [review]
A patch that solves the issue - this works with the given file but most likely should be rewritten to match the Firefox coding guidelines.
Review of attachment 8702544 [details] [diff] [review]:
-----------------------------------------------------------------
thank you.
Your analysis was spot on.
Very lucky for us that this flag is rarely used!
Attachment #8702544 -
Flags: review?(giles) → review+
Comment 7•9 years ago
|
||
bugherder |
Status: UNCONFIRMED → RESOLVED
Closed: 9 years ago
status-firefox47:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla47
Assignee | ||
Comment 8•9 years ago
|
||
Attachment #8716830 -
Flags: review+
Assignee | ||
Updated•9 years ago
|
Attachment #8702544 -
Attachment is obsolete: true
Assignee | ||
Comment 9•9 years ago
|
||
Comment on attachment 8716830 [details] [diff] [review]
[mp4] Properly parse tfhd box.
Approval Request Comment
[Feature/regressing bug #]: 1235427
[User impact if declined]: Valid MP4 will cause decoding error.
[Describe test coverage new/current, TreeHerder]: In central, manual test, confirmed that provided sample now play well. Lots of MP4 regression tests.
[Risks and why]: Low, we are just parsing a MP4 as per spec. Most MP4 content do not use this particular feature causing the bug to be bypassed (and will also bypass the fix)
[String/UUID change made/needed]: None
Attachment #8716830 -
Flags: approval-mozilla-beta?
Attachment #8716830 -
Flags: approval-mozilla-aurora?
Updated•9 years ago
|
status-firefox45:
--- → affected
status-firefox46:
--- → affected
Comment 10•9 years ago
|
||
Comment on attachment 8716830 [details] [diff] [review]
[mp4] Properly parse tfhd box.
Improve mp4 support, taking it.
Should be in 45 beta 4.
Attachment #8716830 -
Flags: approval-mozilla-beta?
Attachment #8716830 -
Flags: approval-mozilla-beta+
Attachment #8716830 -
Flags: approval-mozilla-aurora?
Attachment #8716830 -
Flags: approval-mozilla-aurora+
Comment 11•9 years ago
|
||
bugherder uplift |
Comment 12•9 years ago
|
||
bugherder uplift |
You need to log in
before you can comment on or make changes to this bug.
Description
•