Alexei Podtelezhnikov pushed to branch master at FreeType / FreeType
Commits:
-
72e199e8
by Alexei Podtelezhnikov (Алексей Подтележников) at 2024-08-01T21:12:41-04:00
-
a48cddde
by Alexei Podtelezhnikov (Алексей Подтележников) at 2024-08-01T21:15:46-04:00
2 changed files:
Changes:
... | ... | @@ -763,10 +763,10 @@ |
763 | 763 | case ft_frame_bytes: /* read a byte sequence */
|
764 | 764 | case ft_frame_skip: /* skip some bytes */
|
765 | 765 | {
|
766 | - FT_UInt len = fields->size;
|
|
766 | + FT_Int len = fields->size;
|
|
767 | 767 | |
768 | 768 | |
769 | - if ( cursor + len > stream->limit )
|
|
769 | + if ( len > stream->limit - cursor )
|
|
770 | 770 | {
|
771 | 771 | error = FT_THROW( Invalid_Stream_Operation );
|
772 | 772 | goto Exit;
|
... | ... | @@ -359,8 +359,8 @@ |
359 | 359 | if ( type_id == 0x8008U )
|
360 | 360 | {
|
361 | 361 | font_count = count;
|
362 | - font_offset = FT_STREAM_POS() + 4 +
|
|
363 | - (FT_ULong)( stream->cursor - stream->limit );
|
|
362 | + font_offset = FT_STREAM_POS() + 4 -
|
|
363 | + (FT_ULong)( stream->limit - stream->cursor );
|
|
364 | 364 | break;
|
365 | 365 | }
|
366 | 366 |