[base] Avoid undefined behaviour in lcd filtering code (#53727).

* src/base/ftlcdfil.c (ft_lcd_filter_fir, _ft_lcd_filter_legacy):
Ensure `height > 0'.
This commit is contained in:
Ben Wagner 2018-04-24 10:29:19 +02:00 committed by Werner Lemberg
parent 67697d0076
commit 2157d8fa6f
2 changed files with 9 additions and 2 deletions

View File

@ -1,3 +1,10 @@
2018-04-24 Ben Wagner <bungeman@google.com>
[base] Avoid undefined behaviour in lcd filtering code (#53727).
* src/base/ftlcdfil.c (ft_lcd_filter_fir, _ft_lcd_filter_legacy):
Ensure `height > 0'.
2018-04-22 Werner Lemberg <wl@gnu.org>
* src/base/ftoutln.c (FT_Outline_Decompose): Improve error tracing.

View File

@ -77,7 +77,7 @@
/* take care of bitmap flow */
if ( pitch > 0 )
if ( pitch > 0 && height > 0 )
origin += pitch * (FT_Int)( height - 1 );
/* horizontal in-place FIR filter */
@ -192,7 +192,7 @@
/* take care of bitmap flow */
if ( pitch > 0 )
if ( pitch > 0 && height > 0 )
origin += pitch * (FT_Int)( height - 1 );
/* horizontal in-place intra-pixel filter */