Browse Source

RegisterCustomVariantType: initialize the customvariant array to the correct length before assigning new value

git-svn-id: trunk@36343 -
Marc Weustink 8 years ago
parent
commit
2b2200fcc6
1 changed files with 1 additions and 1 deletions
  1. 1 1
      packages/rtl-objpas/src/inc/variants.pp

+ 1 - 1
packages/rtl-objpas/src/inc/variants.pp

@@ -3897,7 +3897,7 @@ begin
 
 
     index:=RequestedVarType-CMinVarType;
     index:=RequestedVarType-CMinVarType;
     if index>=L then
     if index>=L then
-      SetLength(customvarianttypes,L+1);
+      SetLength(customvarianttypes,index+1);
     if Assigned(customvarianttypes[index]) then
     if Assigned(customvarianttypes[index]) then
     begin
     begin
       if customvarianttypes[index]=InvalidCustomVariantType then
       if customvarianttypes[index]=InvalidCustomVariantType then