소스 검색

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

git-svn-id: trunk@40964 -
nickysn 6 년 전
부모
커밋
e6835e8ff7
1개의 변경된 파일5개의 추가작업 그리고 0개의 파일을 삭제
  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;