contrib/sdk/sources/freetype/src/sfnt/ttsbit.c: (tt_sbit_decoder_init): Protect against addition and multiplication overflow.
Some checks failed
Build system / Check kernel codestyle (pull_request) Has been cancelled
Build system / Build (pull_request) Has been cancelled

This commit is contained in:
2025-12-22 04:12:27 +07:00
parent d0de275ab3
commit ccf97296d0

View File

@@ -234,9 +234,11 @@
p += 34;
decoder->bit_depth = *p;
if ( decoder->strike_index_array > face->sbit_table_size ||
decoder->strike_index_array + 8 * decoder->strike_index_count >
face->sbit_table_size )
/* decoder->strike_index_array + */
/* 8 * decoder->strike_index_count > face->sbit_table_size ? */
if ( decoder->strike_index_array > face->sbit_table_size ||
decoder->strike_index_count >
( face->sbit_table_size - decoder->strike_index_array ) / 8 )
error = FT_THROW( Invalid_File_Format );
}