fixed: crash in rar seek code under certain circumstances
authorspiff <spiff@xbmc.org>
Thu, 1 Dec 2011 20:36:41 +0000 (21:36 +0100)
committerspiff <spiff@xbmc.org>
Thu, 1 Dec 2011 20:38:20 +0000 (21:38 +0100)
if the last archive in a set was less than 256kb, the seek
code set an invalid offset leading to crashes

lib/UnrarXLib/rdwrfn.cpp

index 94c8ea4..4eae8fa 100644 (file)
@@ -82,7 +82,7 @@ int ComprDataIO::UnpRead(byte *Addr,uint Count)
             {
               if (CurUnpStart+MAXWINMEMSIZE>SrcArc->NewLhd.FullUnpSize)
               {
-                m_iSeekTo=SrcArc->NewLhd.FullUnpSize-iSeekTo+iStartOfFile; // back
+                m_iSeekTo=iStartOfFile;
                 UnpPackedSize = SrcArc->NewLhd.FullPackSize;
               }
               else