AAC reader: use 64-bit integer types in file size related calculations

Otherwise files bigger than 2 GB result in negative numbers…

Fixes #3059.
This commit is contained in:
Moritz Bunkus 2021-04-04 11:38:05 +02:00
parent 3dec8ccbc1
commit 17e0c11909
No known key found for this signature in database
GPG Key ID: 74AF00ADF2E32C85
2 changed files with 5 additions and 3 deletions

View File

@ -63,6 +63,8 @@
* mkvmerge: HEVC/H.265: mkvextract will now normalize the placement of VPS,
SPS and PPS NALUs. Each key frame is prefixed with exactly one copy of the
currently active parameter sets.
* mkvmerge: AAC reader: fixed mkvmerge aborting to read AAC files bigger than
2 GB with a message about not being able to allocate memory. Fixes #3059.
## Build system changes

View File

@ -105,9 +105,9 @@ aac_reader_c::create_packetizer(int64_t) {
file_status_e
aac_reader_c::read(generic_packetizer_c *,
bool) {
int remaining_bytes = m_size - m_in->getFilePointer();
auto read_len = std::min<int64_t>(m_chunk->get_size(), remaining_bytes);
int num_read = m_in->read(m_chunk, read_len);
auto remaining_bytes = m_size - m_in->getFilePointer();
auto read_len = std::min(m_chunk->get_size(), remaining_bytes);
auto num_read = m_in->read(m_chunk, read_len);
if (0 < num_read) {
m_parser.add_bytes(m_chunk->get_buffer(), num_read);