[truetype] Prevent address overflow (#51365).

* src/truetype/ttgxvar.c (FT_Stream_SeekSet): Add guard.
This commit is contained in:
Werner Lemberg 2017-07-04 08:08:54 +02:00
parent c56d8851ea
commit 1c85479d2d
2 changed files with 10 additions and 2 deletions

View File

@ -1,3 +1,9 @@
2017-07-04 Werner Lemberg <wl@gnu.org>
[truetype] Prevent address overflow (#51365).
* src/truetype/ttgxvar.c (FT_Stream_SeekSet): Add guard.
2017-07-03 Alexei Podtelezhnikov <apodtele@gmail.com>
* src/base/ftlcdfil.c (ft_lcd_filter_fir): Improve code.

View File

@ -60,8 +60,10 @@
#define FT_Stream_FTell( stream ) \
(FT_ULong)( (stream)->cursor - (stream)->base )
#define FT_Stream_SeekSet( stream, off ) \
( (stream)->cursor = (stream)->base + (off) )
#define FT_Stream_SeekSet( stream, off ) \
(stream)->cursor = ( (off) < (stream)->limit - (stream)->base ) \
? (stream)->base + (off) \
: (stream)->limit
/*************************************************************************/