mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-04-14 07:59:35 +02:00
* fixed crash when trying to load an image type fpimage doesn't support
git-svn-id: trunk@17849 -
This commit is contained in:
parent
332993241d
commit
e059ec103f
@ -139,16 +139,18 @@ begin
|
||||
FileExt := ExtractFileExt(URL);
|
||||
|
||||
Picture := TPicture.Create;
|
||||
Stream := fChm.GetObject('/'+URL);
|
||||
try
|
||||
Stream := fChm.GetObject('/'+URL);
|
||||
if Assigned(Stream) then
|
||||
if Assigned(Stream) then
|
||||
begin
|
||||
Stream.Position := 0;
|
||||
Picture.LoadFromStreamWithFileExt(Stream, FileExt);
|
||||
end;
|
||||
finally
|
||||
Stream.Free;
|
||||
except
|
||||
// only happens if it's an image type we can't handle
|
||||
end;
|
||||
if Stream <> nil then
|
||||
Stream.Free;
|
||||
end;
|
||||
|
||||
function TIpChmDataProvider.CanHandle(const URL: string): Boolean;
|
||||
|
Loading…
Reference in New Issue
Block a user