mirror of
https://gitlab.com/mbunkus/mkvtoolnix.git
synced 2024-12-24 11:54:01 +00:00
MP4 reader: refactor parsing of codec private data
This commit is contained in:
parent
7f7c36c1ad
commit
f5c1bf8585
@ -3066,17 +3066,16 @@ qtmp4_demuxer_c::parse_video_header_priv_atoms(uint64_t atom_size,
|
||||
mxdebug_if(m_debug_headers, fmt::format("{0}Video private data size: {1}, type: '{2}'\n", space((level + 1) * 2 + 1), atom.size, atom.fourcc));
|
||||
|
||||
if (mtx::included_in(atom.fourcc, "esds", "avcC", "hvcC", "av1C")) {
|
||||
if (priv.empty()) {
|
||||
priv.emplace_back(memory_c::alloc(atom.size - atom.hsize));
|
||||
auto atom_data = memory_c::alloc(atom.size - atom.hsize);
|
||||
|
||||
if (mio.read(priv[0], priv[0]->get_size()) != priv[0]->get_size()) {
|
||||
priv.clear();
|
||||
return;
|
||||
}
|
||||
}
|
||||
if (mio.read(atom_data->get_buffer(), atom_data->get_size()) != atom_data->get_size())
|
||||
return;
|
||||
|
||||
if (priv.empty())
|
||||
priv.emplace_back(atom_data);
|
||||
|
||||
if ((atom.fourcc == "esds") && !esds_parsed) {
|
||||
mm_mem_io_c memio(priv[0]->get_buffer(), priv[0]->get_size());
|
||||
mm_mem_io_c memio{*atom_data};
|
||||
esds_parsed = parse_esds_atom(memio, level + 1);
|
||||
}
|
||||
|
||||
|
@ -405,7 +405,7 @@ T_556prores:fec4ef711257d881467a9c20b430e9df-52d0f6381f7e86c58a68e150073c87ab-74
|
||||
T_557dts_hd_ma_xll_extension:96000-192000-d633335e8baafba31fcc4f20cb86f533-d633335e8baafba31fcc4f20cb86f533:passed:20160810-203155:1.196256604
|
||||
T_558segfaults_issue_1780_part_1:error-error-error-error-error:passed:20160906-210126:0.035867258
|
||||
T_559segfaults_issue_1780_part_2:error-error-error-error-error-error-error-error-error-error-error-error-error-error-error-error-error-error-error-error-error-error-error-error-error-error-error-error:passed:20160906-225430:0.206571838
|
||||
T_560segfaults_issue_1780_part_3:57251a83113110913eaa72b84850a4aa-57251a83113110913eaa72b84850a4aa-57251a83113110913eaa72b84850a4aa-57251a83113110913eaa72b84850a4aa-57251a83113110913eaa72b84850a4aa-57251a83113110913eaa72b84850a4aa-57251a83113110913eaa72b84850a4aa-e52483f75983b811494caa4407f4ff37-0b69a1909e65bfa5b139be5d151984f9-57251a83113110913eaa72b84850a4aa-18a9ae8fc4fd5b091ef2d4c2c329cf09-45c56a96c2475ab00b201caf576d55c5-a83979198b6a0989289e7d727b4ebfab-57251a83113110913eaa72b84850a4aa-2c34bde87bf0ca4cda809929f8fdd8d3-6612f01970f6151604d6294afa7d610c-6612f01970f6151604d6294afa7d610c-6612f01970f6151604d6294afa7d610c-6612f01970f6151604d6294afa7d610c-6612f01970f6151604d6294afa7d610c-ok:passed:20160906-225653:0.203842645
|
||||
T_560segfaults_issue_1780_part_3:57251a83113110913eaa72b84850a4aa-57251a83113110913eaa72b84850a4aa-57251a83113110913eaa72b84850a4aa-57251a83113110913eaa72b84850a4aa-57251a83113110913eaa72b84850a4aa-57251a83113110913eaa72b84850a4aa-57251a83113110913eaa72b84850a4aa-e52483f75983b811494caa4407f4ff37-2bacc50e6e28fb2a92d2abf2583405f5-57251a83113110913eaa72b84850a4aa-18a9ae8fc4fd5b091ef2d4c2c329cf09-45c56a96c2475ab00b201caf576d55c5-2bacc50e6e28fb2a92d2abf2583405f5-57251a83113110913eaa72b84850a4aa-2c34bde87bf0ca4cda809929f8fdd8d3-6612f01970f6151604d6294afa7d610c-6612f01970f6151604d6294afa7d610c-6612f01970f6151604d6294afa7d610c-6612f01970f6151604d6294afa7d610c-6612f01970f6151604d6294afa7d610c-warning:passed:20160906-225653:0.203842645
|
||||
T_561segfaults_issue_1780_part_4:error:passed:20160906-225808:0.007751455
|
||||
T_562segfaults_issue_1780_part_5:error-acf64b0e9d4c9d7e4104f225f64ba0ce-warning:passed:20160906-225922:0.023945323
|
||||
T_563segfaults_issue_1780_part_6:error-error:passed:20160906-230017:0.014380789
|
||||
|
@ -6,6 +6,13 @@ describe "mkvmerge / various test cases for segfaults collected in issue 1780 pa
|
||||
dir = "data/segfaults-assertions/issue-1780"
|
||||
|
||||
# "MP4 reader: fix access beyond end of vector"
|
||||
|
||||
exit_codes = {
|
||||
'explorer:id:000097,sig:06,src:000005,op:flip1,pos:13730' => :warning,
|
||||
'explorer:id:000261,sig:11,src:000013,op:arith8,pos:13647,val:+7' => :warning,
|
||||
'explorer:id:000323,sig:06,src:000314,op:flip1,pos:13731' => :warning,
|
||||
}
|
||||
|
||||
%w{
|
||||
explorer:id:000011,sig:11,src:000001,op:flip1,pos:42
|
||||
explorer:id:000012,sig:11,src:000001,op:flip1,pos:13438
|
||||
@ -28,7 +35,7 @@ explorer:id:000354,sig:11,src:000426,op:flip1,pos:13825
|
||||
explorer:id:000357,sig:11,src:000426,op:flip2,pos:13825
|
||||
explorer:id:000358,sig:06,src:000426,op:flip2,pos:13826
|
||||
}.each do |file|
|
||||
test_merge "#{dir}/#{file}"
|
||||
test_merge "#{dir}/#{file}", :exit_code => exit_codes[file] || :ok
|
||||
end
|
||||
|
||||
# The following files cause uninitialized memory to be written and
|
||||
@ -36,5 +43,5 @@ end
|
||||
%w{
|
||||
explorer:id:000323,sig:06,src:000314,op:flip1,pos:13731
|
||||
}.each do |file|
|
||||
test_merge "#{dir}/#{file}", :result_type => :exit_code_string
|
||||
test_merge "#{dir}/#{file}", :result_type => :exit_code_string, :exit_code => exit_codes[file] || :ok
|
||||
end
|
||||
|
Loading…
Reference in New Issue
Block a user