Fixed: DrawGraphic checks AIndex, caused infinite AVs otherwise when using an invalid index

This commit is contained in:
Mark van Renswoude 2004-10-07 18:21:44 +00:00
parent 491c12aad5
commit 4e24a4cd67
3 changed files with 55 additions and 7 deletions

View File

@ -32,5 +32,5 @@
-M
-$M16384,1048576
-K$00400000
-LE"c:\delphi6\Projects\Bpl"
-LN"c:\delphi6\Projects\Bpl"
-LE"c:\program files\borland\delphi7\Projects\Bpl"
-LN"c:\program files\borland\delphi7\Projects\Bpl"

View File

@ -1,5 +1,5 @@
[FileVersion]
Version=6.0
Version=7.0
[Compiler]
A=8
B=0
@ -30,6 +30,55 @@ Z=1
ShowHints=1
ShowWarnings=1
UnitAliases=WinTypes=Windows;WinProcs=Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE;
NamespacePrefix=
SymbolDeprecated=1
SymbolLibrary=1
SymbolPlatform=1
UnitLibrary=1
UnitPlatform=1
UnitDeprecated=1
HResultCompat=1
HidingMember=1
HiddenVirtual=1
Garbage=1
BoundsError=1
ZeroNilCompat=1
StringConstTruncated=1
ForLoopVarVarPar=1
TypedConstVarPar=1
AsgToTypedConst=1
CaseLabelRange=1
ForVariable=1
ConstructingAbstract=1
ComparisonFalse=1
ComparisonTrue=1
ComparingSignedUnsigned=1
CombiningSignedUnsigned=1
UnsupportedConstruct=1
FileOpen=1
FileOpenUnitSrc=1
BadGlobalSymbol=1
DuplicateConstructorDestructor=1
InvalidDirective=1
PackageNoLink=1
PackageThreadVar=1
ImplicitImport=1
HPPEMITIgnored=1
NoRetVal=1
UseBeforeDef=1
ForLoopVarUndef=1
UnitNameMismatch=1
NoCFGFileFound=1
MessageDirective=1
ImplicitVariants=1
UnicodeToLocale=1
LocaleToUnicode=1
ImagebaseMultiple=1
SuspiciousTypecast=1
PrivatePropAccessor=1
UnsafeType=1
UnsafeCode=1
UnsafeCast=1
[Linker]
MapFile=3
OutputObjs=0
@ -56,10 +105,6 @@ HostApplication=
Launcher=
UseLauncher=0
DebugCWD=
[Language]
ActiveLang=
ProjectLang=
RootDir=
[Version Info]
IncludeVerInfo=1
AutoIncBuild=0

View File

@ -523,6 +523,9 @@ var
begin
Result := False;
if (AIndex < 0) or (AIndex >= Count) then
exit;
if (not Assigned(FContainer)) or
(not Assigned(FContainer.Graphics[AIndex].Picture.Graphic)) or
(FContainer.Graphics[AIndex].Picture.Graphic.Empty) then