mirror of
https://gitlab.com/mbunkus/mkvtoolnix.git
synced 2024-12-24 11:54:01 +00:00
HEVC parser: catch exceptions during NALU parsing
Found by fuzzying.
This commit is contained in:
parent
74c5272591
commit
26bbd99ec2
2
NEWS.md
2
NEWS.md
@ -20,6 +20,8 @@
|
||||
from "at least one entry selected" to "no entry selected", the input
|
||||
controls will be reset to their default state and not just disabled. Fixes
|
||||
#2927.
|
||||
* mkvmerge: HEVC parser: fixed mkvmerge aborting after uncaught exceptions due
|
||||
to certain data constellations found by fuzzying.
|
||||
|
||||
|
||||
# Version 50.0.0 "Awakenings" 2020-09-06
|
||||
|
@ -469,8 +469,8 @@ es_parser_c::handle_sei_nalu(memory_cptr const &nalu) {
|
||||
}
|
||||
|
||||
void
|
||||
es_parser_c::handle_nalu(memory_cptr const &nalu,
|
||||
uint64_t nalu_pos) {
|
||||
es_parser_c::handle_nalu_internal(memory_cptr const &nalu,
|
||||
uint64_t nalu_pos) {
|
||||
if (1 > nalu->get_size())
|
||||
return;
|
||||
|
||||
@ -546,6 +546,17 @@ es_parser_c::handle_nalu(memory_cptr const &nalu,
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
es_parser_c::handle_nalu(memory_cptr const &nalu,
|
||||
uint64_t nalu_pos) {
|
||||
try {
|
||||
handle_nalu_internal(nalu, nalu_pos);
|
||||
|
||||
} catch (bool) {
|
||||
} catch (mtx::mm_io::end_of_file_x const &) {
|
||||
}
|
||||
}
|
||||
|
||||
bool
|
||||
es_parser_c::parse_slice(memory_cptr const &nalu,
|
||||
slice_info_t &si) {
|
||||
|
@ -208,6 +208,7 @@ public:
|
||||
|
||||
protected:
|
||||
bool parse_slice(memory_cptr const &nalu, slice_info_t &si);
|
||||
void handle_nalu_internal(memory_cptr const &nalu, uint64_t nalu_pos);
|
||||
void handle_vps_nalu(memory_cptr const &nalu);
|
||||
void handle_sps_nalu(memory_cptr const &nalu);
|
||||
void handle_pps_nalu(memory_cptr const &nalu);
|
||||
|
@ -555,3 +555,4 @@ T_706bcp47_mkvmerge_tracks_disable_language_ietf:d3debb1ac7a98668c4cac753891185b
|
||||
T_707bcp47_mkvmerge_chapters_disable_language_ietf:2a2202254f1e426484151e9299f83841-ok-b6807e13a6ea9a2cc609e86b3e9af87d-ok-b6807e13a6ea9a2cc609e86b3e9af87d-ok-b34723deaedf0499e3867766749863b2-ok-b34723deaedf0499e3867766749863b2-ok-b34723deaedf0499e3867766749863b2-ok-ff2908a5f9aedaca69790c4ec909a829-ok-fcf93dcc200afe462b71d16d7c9fef90-ok-fcf93dcc200afe462b71d16d7c9fef90-ok:passed:20200829-101752:0.197644079
|
||||
T_708bcp47_propedit_language_ietf_disable_language_ietf:d80d696e8045ebf157d31db09142307c-und+und+ok+ger+und+ok+ger+pt_BR+ok+spa+pt_BR+ok+eng+pt_BR+ok+eng++ok:passed:20200829-103838:0.0
|
||||
T_709bcp47_mkvmerge_tags:9208217d36fa9368be5a44b239286424:passed:20200903-234135:0.0
|
||||
T_710fuzzying:8a854a7b177603c5291752d2f9520fa0-1b04d1875e32404c86dbef16ddb75db0:passed:20200921-133156:0.016287719
|
||||
|
9
tests/test-710fuzzying.rb
Executable file
9
tests/test-710fuzzying.rb
Executable file
@ -0,0 +1,9 @@
|
||||
#!/usr/bin/ruby -w
|
||||
|
||||
# T_710fuzzying
|
||||
describe "mkvmerge / issues found by fuzzying"
|
||||
|
||||
Dir["data/segfaults-assertions/fuzzying/0001-ac3/**/id*"].each do |file|
|
||||
exit_code = file.gsub(%r{.*/([012])/.*}, '\1').to_i
|
||||
test_merge file, :exit_code => exit_code
|
||||
end
|
Loading…
Reference in New Issue
Block a user