|
@@ -211,7 +211,10 @@ begin
|
|
// skip extensions
|
|
// skip extensions
|
|
Repeat
|
|
Repeat
|
|
Introducer:=SkipBlock(Stream);
|
|
Introducer:=SkipBlock(Stream);
|
|
- until (Introducer = $2C) or (Introducer = $3B);
|
|
|
|
|
|
+ until (Introducer = $2C) or (Introducer = $3B) or (Stream.Position>=Stream.Size);
|
|
|
|
+
|
|
|
|
+ if Stream.Position>=Stream.Size then
|
|
|
|
+ Exit;
|
|
|
|
|
|
// descriptor
|
|
// descriptor
|
|
Stream.Read(FDescriptor, SizeOf(FDescriptor));
|
|
Stream.Read(FDescriptor, SizeOf(FDescriptor));
|
|
@@ -298,7 +301,10 @@ begin
|
|
Stream.Seek(B, soFromCurrent);
|
|
Stream.Seek(B, soFromCurrent);
|
|
CodeMask := (1 shl CodeSize) - 1;
|
|
CodeMask := (1 shl CodeSize) - 1;
|
|
end;
|
|
end;
|
|
- until B = 0;
|
|
|
|
|
|
+ until (B = 0) or (Stream.Position>=Stream.Size);
|
|
|
|
+
|
|
|
|
+ if Stream.Position>=Stream.Size then
|
|
|
|
+ Exit(False);
|
|
|
|
|
|
Progress(psRunning, trunc(100.0 * (Stream.position / Stream.size)),
|
|
Progress(psRunning, trunc(100.0 * (Stream.position / Stream.size)),
|
|
False, Rect(0,0,0,0), '', ContProgress);
|
|
False, Rect(0,0,0,0), '', ContProgress);
|
|
@@ -315,7 +321,11 @@ begin
|
|
Stream.ReadBuffer(SourcePtr^, B);
|
|
Stream.ReadBuffer(SourcePtr^, B);
|
|
Inc(SourcePtr,B);
|
|
Inc(SourcePtr,B);
|
|
end;
|
|
end;
|
|
- until B = 0;
|
|
|
|
|
|
+ until (B = 0) or (Stream.Position>=Stream.Size);
|
|
|
|
+
|
|
|
|
+ if Stream.Position>=Stream.Size then
|
|
|
|
+ Exit(False);
|
|
|
|
+
|
|
|
|
|
|
Progress(psRunning, trunc(100.0 * (Stream.position / Stream.size)),
|
|
Progress(psRunning, trunc(100.0 * (Stream.position / Stream.size)),
|
|
False, Rect(0,0,0,0), '', ContProgress);
|
|
False, Rect(0,0,0,0), '', ContProgress);
|