AC3 parsing: consider frame size 0 an error during header decoding

This commit is contained in:
Moritz Bunkus 2013-12-30 23:29:45 +01:00
parent b01bb3f7f2
commit f658ca7c8c
2 changed files with 10 additions and 1 deletions

View File

@ -1,3 +1,9 @@
2013-12-30 Moritz Bunkus <moritz@bunkus.org>
* mkvmerge: bug fix: Improved the AC3 header decoding error
handling so that the AC3 parsing routines won't get stuck in
endless loops when encountering certain garbage data patterns.
2013-12-29 Moritz Bunkus <moritz@bunkus.org>
* mkvmerge: enhancement: unified codec names output by mkvmerge's

View File

@ -94,6 +94,9 @@ ac3::frame_c::decode_header_type_eac3(bit_reader_c &bc) {
m_sub_stream_id = bc.get_bits(3);
m_bytes = (bc.get_bits(11) + 1) << 1;
if (!m_bytes)
return false;
uint8_t fscod = bc.get_bits(2);
uint8_t fscod2 = bc.get_bits(2);
@ -185,7 +188,7 @@ ac3::frame_c::decode_header_type_ac3(bit_reader_c &bc) {
m_samples = 1536;
m_frame_type = EAC3_FRAME_TYPE_INDEPENDENT;
return true;
return m_bytes != 0;
}
int