mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-07-28 21:36:13 +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);
|
FileExt := ExtractFileExt(URL);
|
||||||
|
|
||||||
Picture := TPicture.Create;
|
Picture := TPicture.Create;
|
||||||
|
Stream := fChm.GetObject('/'+URL);
|
||||||
try
|
try
|
||||||
Stream := fChm.GetObject('/'+URL);
|
if Assigned(Stream) then
|
||||||
if Assigned(Stream) then
|
|
||||||
begin
|
begin
|
||||||
Stream.Position := 0;
|
Stream.Position := 0;
|
||||||
Picture.LoadFromStreamWithFileExt(Stream, FileExt);
|
Picture.LoadFromStreamWithFileExt(Stream, FileExt);
|
||||||
end;
|
end;
|
||||||
finally
|
except
|
||||||
Stream.Free;
|
// only happens if it's an image type we can't handle
|
||||||
end;
|
end;
|
||||||
|
if Stream <> nil then
|
||||||
|
Stream.Free;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function TIpChmDataProvider.CanHandle(const URL: string): Boolean;
|
function TIpChmDataProvider.CanHandle(const URL: string): Boolean;
|
||||||
|
Loading…
Reference in New Issue
Block a user