diff --git a/ChangeLog b/ChangeLog index c17e906e3..3e2c1af2c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2005-04-16 Moritz Bunkus + + * mkvmerge: bug fix: In rare occasions involving B frames mkvmerge + freed data too early. In such a case it was eating more and more + memory finally exiting with a message about not finding a packet + for a "bref". + 2005-04-09 Moritz Bunkus * all: bug fix: My output functions did not work on AMD64 diff --git a/src/merge/pr_generic.cpp b/src/merge/pr_generic.cpp index 230e9aaa7..cfc64650f 100644 --- a/src/merge/pr_generic.cpp +++ b/src/merge/pr_generic.cpp @@ -50,7 +50,8 @@ generic_packetizer_c::generic_packetizer_c(generic_reader_c *nreader, reader = nreader; track_entry = NULL; - free_refs = -1; + m_free_refs = -1; + m_next_free_refs = -1; enqueued_bytes = 0; safety_last_timecode = 0; safety_last_duration = 0; @@ -1073,7 +1074,8 @@ generic_packetizer_c::handle_avi_audio_sync(int64_t num_bytes, void generic_packetizer_c::connect(generic_packetizer_c *src, int64_t _append_timecode_offset) { - free_refs = src->free_refs; + m_free_refs = src->m_free_refs; + m_next_free_refs = src->m_next_free_refs; track_entry = src->track_entry; hserialno = src->hserialno; htrack_type = src->htrack_type; diff --git a/src/merge/pr_generic.h b/src/merge/pr_generic.h index 80054bf31..ce50727c5 100644 --- a/src/merge/pr_generic.h +++ b/src/merge/pr_generic.h @@ -447,7 +447,7 @@ protected: deque packet_queue, deferred_packets; int64_t initial_displacement; - int64_t free_refs, enqueued_bytes; + int64_t m_free_refs, m_next_free_refs, enqueued_bytes; int64_t safety_last_timecode, safety_last_duration; KaxTrackEntry *track_entry; @@ -522,11 +522,12 @@ public: return enqueued_bytes; } - virtual void set_free_refs(int64_t nfree_refs) { - free_refs = nfree_refs; + virtual void set_free_refs(int64_t free_refs) { + m_free_refs = m_next_free_refs; + m_next_free_refs = free_refs; } virtual int64_t get_free_refs() { - return free_refs; + return m_free_refs; } virtual void set_headers(); virtual void fix_headers();