Fix lookup of string encodings with high numeric values in encoding table

This commit is contained in:
Frederik Seiffert 2021-06-17 17:53:22 +02:00
parent 7ea49c252b
commit 8137b5a2a0
2 changed files with 10 additions and 2 deletions

View file

@ -364,10 +364,10 @@ EntryForEncoding(NSStringEncoding enc)
{
struct _strenc_ *entry = 0;
if (enc > 0)
if (enc != 0)
{
GSSetupEncodingTable();
if (enc <= encTableSize)
if (enc > 0 && enc <= encTableSize)
{
entry = encodingTable[enc];
}