mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-04-22 10:59:29 +02:00
TAChart: Fix crash in stacked bar series due to dd3322cfc0
This commit is contained in:
parent
68acca089e
commit
ebd45b7c62
@ -1429,10 +1429,14 @@ begin
|
||||
FCumulativeExtentIsValid := false;
|
||||
FXListExtentIsValid := false;
|
||||
FYListExtentIsValid := false;
|
||||
SetLength(FYRangeValid, YCount);
|
||||
SetLength(FYRange, YCount);
|
||||
for i := 0 to High(FYRange) do
|
||||
FYRangeValid[i] := false;
|
||||
if YCount <> MaxInt then
|
||||
begin
|
||||
SetLength(FYRangeValid, YCount);
|
||||
SetLength(FYRange, YCount);
|
||||
for i := 0 to High(FYRange) do
|
||||
FYRangeValid[i] := false;
|
||||
end else
|
||||
SetLength(FYRangeValid, 0);
|
||||
end;
|
||||
|
||||
function TCustomChartSource.IsErrorBarDataStored(AIndex: Integer): Boolean;
|
||||
@ -1699,7 +1703,7 @@ procedure TCustomChartSource.YRange(AYIndex: Integer; var AMin, AMax: Double);
|
||||
var
|
||||
i, yIdx: Integer;
|
||||
begin
|
||||
if FYRangeValid[AYIndex] then
|
||||
if (AYIndex < Length(FYRangeValid)) and FYRangeValid[AYIndex] then
|
||||
begin
|
||||
AMin := FYRange[AYIndex].FStart;
|
||||
AMax := FYRange[AYIndex].FEnd;
|
||||
|
Loading…
Reference in New Issue
Block a user