* src/base/ftstream.c (FT_Stream_ReadFields): Update condition.

This commit is contained in:
Alexei Podtelezhnikov 2024-08-01 21:12:41 -04:00
parent 7c75b8a7bd
commit 72e199e8d3
1 changed files with 2 additions and 2 deletions

View File

@ -763,10 +763,10 @@
case ft_frame_bytes: /* read a byte sequence */
case ft_frame_skip: /* skip some bytes */
{
FT_UInt len = fields->size;
FT_Int len = fields->size;
if ( cursor + len > stream->limit )
if ( len > stream->limit - cursor )
{
error = FT_THROW( Invalid_Stream_Operation );
goto Exit;