Browse Source

* added check to ensure the memory allocation for DrawnList inside FloodFill hasn't returned nil

git-svn-id: trunk@40964 -
nickysn 6 years ago
parent
commit
e6835e8ff7
1 changed files with 5 additions and 0 deletions
  1. 5 0
      packages/graph/src/inc/fills.inc

+ 5 - 0
packages/graph/src/inc/fills.inc

@@ -435,6 +435,11 @@ var
    x1, x2, prevy: smallint;
   Begin
     GetMem(DrawnList,sizeof(PFloodLine)*((ViewHeight div YResDiv) + 1));
+    if not assigned(DrawnList) then
+      begin
+        _GraphResult := grNoFloodMem;
+        exit;
+      end;
     FillChar(DrawnList^,sizeof(PFloodLine)*((ViewHeight div YResDiv) + 1),0);
     { init prevy }
     prevy := 32767;