From d8ef726611459a40e4e27a6602855bc27535a548 Mon Sep 17 00:00:00 2001 From: Werner Lemberg Date: Fri, 2 Sep 2016 23:27:50 +0200 Subject: [PATCH] [sfnt] Avoid left shift of negative value (#48980). * src/sfnt/ttsbit.c (tt_sbit_decoder_load_bit_aligned): Use unsigned constant. --- ChangeLog | 9 ++++++++- src/sfnt/ttsbit.c | 2 +- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index f786a8abc..e998fa7b6 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,4 +1,11 @@ -2016-09-02 Werner Lemberg . +2016-09-02 Werner Lemberg + + [sfnt] Avoid left shift of negative value (#48980). + + * src/sfnt/ttsbit.c (tt_sbit_decoder_load_bit_aligned): Use unsigned + constant. + +2016-09-02 Werner Lemberg * src/smooth/ftgrays.c (gray_hline): Fix clang compiler warnings. diff --git a/src/sfnt/ttsbit.c b/src/sfnt/ttsbit.c index 5b7a12351..36c261dcc 100644 --- a/src/sfnt/ttsbit.c +++ b/src/sfnt/ttsbit.c @@ -881,7 +881,7 @@ } *pwrite++ |= ( ( rval >> nbits ) & 0xFF ) & - ( ~( 0xFF << w ) << ( 8 - w - x_pos ) ); + ( ~( 0xFFU << w ) << ( 8 - w - x_pos ) ); rval <<= 8; w = line_bits - w;