From accadda17dbdc888c65bbcda4ea383fc1299236a Mon Sep 17 00:00:00 2001 From: vng Date: Mon, 18 Aug 2014 20:54:15 +0300 Subject: [PATCH] Fixed bug in files container. --- coding/file_container.hpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/coding/file_container.hpp b/coding/file_container.hpp index 715023d0c9..722c0cee65 100644 --- a/coding/file_container.hpp +++ b/coding/file_container.hpp @@ -44,7 +44,14 @@ protected: { bool operator() (Info const & t1, Info const & t2) const { - return (t1.m_offset < t2.m_offset); + if (t1.m_offset == t2.m_offset) + { + // Element with nonzero size should be the last one, + // for correct append writer mode (FilesContainerW::GetWriter). + return (t1.m_size < t2.m_size); + } + else + return (t1.m_offset < t2.m_offset); } bool operator() (Info const & t1, uint64_t const & t2) const {