Kaynağa Gözat

Bug on UFileStorage

PascalCoin 7 yıl önce
ebeveyn
işleme
daf1e93d99
1 değiştirilmiş dosya ile 3 ekleme ve 1 silme
  1. 3 1
      src/core/UFileStorage.pas

+ 3 - 1
src/core/UFileStorage.pas

@@ -234,7 +234,9 @@ begin
     if Not GetBlockHeaderFirstBytePosition(stream,StartingDeleteBlock,False,iBlockHeaders,BlockHeaderFirstBlock) then exit;
     If Not StreamReadBlockHeader(Stream,iBlockHeaders,BlockHeaderFirstBlock,StartingDeleteBlock,True,_Header) then exit;
     _intBlockIndex := (_Header.BlockNumber-BlockHeaderFirstBlock);
-    p := Int64(_intBlockIndex) * Int64(CT_SizeOfBlockHeader);
+//XXXXXXXXXX BUG !!!    p := Int64(_intBlockIndex) * Int64(CT_SizeOfBlockHeader);
+    p := FBlockHeadersFirstBytePosition[iBlockHeaders] + (Int64(_intBlockIndex) * Int64(CT_SizeOfBlockHeader));
+
     Stream.Position:=p;
     // Write null data until end of header
     GrowStreamUntilPos(Stream,FBlockHeadersFirstBytePosition[iBlockHeaders] + GetBlockHeaderFixedSize,true);