diff options
author | David Tardon <dtardon@redhat.com> | 2011-05-11 12:00:57 +0200 |
---|---|---|
committer | David Tardon <dtardon@redhat.com> | 2011-05-11 12:00:57 +0200 |
commit | 41d0cc5ca747360197bb67b3c289b721c7fc932e (patch) | |
tree | cae3f1c8d0ff4aad7ac6c7eccd9fb272bf51a818 /vcl | |
parent | 9e3928b9dcbda83580ae6ab62cbb63e79f8a2aee (diff) |
guard against invalid args
Diffstat (limited to 'vcl')
-rw-r--r-- | vcl/unx/source/fontmanager/fontmanager.cxx | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/vcl/unx/source/fontmanager/fontmanager.cxx b/vcl/unx/source/fontmanager/fontmanager.cxx index c4a962ae9e62..1aced1e9fb8c 100644 --- a/vcl/unx/source/fontmanager/fontmanager.cxx +++ b/vcl/unx/source/fontmanager/fontmanager.cxx @@ -3168,6 +3168,10 @@ bool PrintFontManager::getMetrics( fontID nFontID, const sal_Unicode* pString, i bool PrintFontManager::getMetrics( fontID nFontID, sal_Unicode minCharacter, sal_Unicode maxCharacter, CharacterMetric* pArray, bool bVertical ) const { + OSL_PRECOND(minCharacter <= maxCharacter, "invalid char. range"); + if (minCharacter > maxCharacter) + return false; + PrintFont* pFont = getFont( nFontID ); if( ! pFont ) return false; |