mirror of
https://gitlab.com/mbunkus/mkvtoolnix.git
synced 2024-12-29 14:27:42 +00:00
Fixed a couple of memory leaks.
This commit is contained in:
parent
89d0e2ea60
commit
1cf47a12f2
@ -1,3 +1,7 @@
|
||||
2007-06-25 Moritz Bunkus <moritz@bunkus.org>
|
||||
|
||||
* mkvmerge: bug fixes: Fixed a couple of memory leaks.
|
||||
|
||||
2007-06-24 Moritz Bunkus <moritz@bunkus.org>
|
||||
|
||||
* mkvmerge: new feature: Added better checks if two tracks can be
|
||||
|
@ -500,8 +500,7 @@ mpeg4::p10::nalu_to_rbsp(memory_cptr &buffer) {
|
||||
d.write_uint8(b[pos]);
|
||||
}
|
||||
|
||||
buffer = memory_cptr(new memory_c(d.get_and_lock_buffer(),
|
||||
d.getFilePointer()));
|
||||
buffer = memory_cptr(new memory_c(d.get_and_lock_buffer(), d.getFilePointer(), true));
|
||||
}
|
||||
|
||||
void
|
||||
@ -522,8 +521,7 @@ mpeg4::p10::rbsp_to_nalu(memory_cptr &buffer) {
|
||||
d.write_uint8(b[pos]);
|
||||
}
|
||||
|
||||
buffer = memory_cptr(new memory_c(d.get_and_lock_buffer(),
|
||||
d.getFilePointer()));
|
||||
buffer = memory_cptr(new memory_c(d.get_and_lock_buffer(), d.getFilePointer(), true));
|
||||
}
|
||||
|
||||
bool
|
||||
@ -532,7 +530,7 @@ mpeg4::p10::parse_sps(memory_cptr &buffer,
|
||||
bool keep_ar_info) {
|
||||
int size = buffer->get_size();
|
||||
unsigned char *newsps = (unsigned char *)safemalloc(size + 100);
|
||||
memory_cptr mcptr_newsps(new memory_c(newsps, size));
|
||||
memory_cptr mcptr_newsps(new memory_c(newsps, size, true));
|
||||
bit_cursor_c r(buffer->get(), size);
|
||||
bit_writer_c w(newsps, size);
|
||||
int i, nref, mb_width, mb_height;
|
||||
|
@ -890,7 +890,7 @@ mpeg4_p10_video_packetizer_c::change_nalu_size_len(packet_cptr packet) {
|
||||
// than the previous one. Otherwise reuse the existing memory.
|
||||
if (m_nalu_size_len_dst > m_nalu_size_len_src) {
|
||||
int new_size = size + nalu_sizes.size() * (m_nalu_size_len_dst - m_nalu_size_len_src);
|
||||
packet->data = memory_cptr(new memory_c((unsigned char *)safemalloc(new_size), new_size));
|
||||
packet->data = memory_cptr(new memory_c((unsigned char *)safemalloc(new_size), new_size, true));
|
||||
}
|
||||
|
||||
// Copy the NALUs and write the new sized length field.
|
||||
|
Loading…
Reference in New Issue
Block a user