diff --git a/packages/fcl-base/src/gettext.pp b/packages/fcl-base/src/gettext.pp index e6223125f0..6c86c060b9 100644 --- a/packages/fcl-base/src/gettext.pp +++ b/packages/fcl-base/src/gettext.pp @@ -174,12 +174,17 @@ function TMOFile.Translate(AOrig: PChar; ALen: Integer; AHash: LongWord): String var idx, incr, nstr: LongWord; begin + if AHash = $FFFFFFFF then + begin + Result := ''; + exit; + end; idx := AHash mod HashTableSize; incr := 1 + (AHash mod (HashTableSize - 2)); while True do begin nstr := HashTable^[idx]; - if nstr = 0 then + if (nstr = 0) or (nstr > StringCount) then begin Result := ''; exit;