[smooth] Fix uninitialized memory access.

Looks like `ras.span_y' could always be used without initialization.
This was never detected by valgrind before because the library-wide
`raster_pool' was used for the worker object and `raster_pool' was
originally zero'ed.  But subsequent reuses of it were using `span_y'
uninitialized.  With the recent change to not use `render_pool' and
allocate worker and buffer on the stack, valgrind now detects this
uninitialized access.

* src/smooth/ftgrays.c (gray_raster_render): Initialize
`ras.span_y'.
This commit is contained in:
Behdad Esfahbod 2015-01-14 18:43:13 +01:00 committed by Werner Lemberg
parent 603292d7b0
commit b2ba68665f
2 changed files with 16 additions and 0 deletions

View File

@ -1,3 +1,18 @@
2015-01-14 Behdad Esfahbod <behdad@behdad.org>
[smooth] Fix uninitialized memory access.
Looks like `ras.span_y' could always be used without initialization.
This was never detected by valgrind before because the library-wide
`raster_pool' was used for the worker object and `raster_pool' was
originally zero'ed. But subsequent reuses of it were using `span_y'
uninitialized. With the recent change to not use `render_pool' and
allocate worker and buffer on the stack, valgrind now detects this
uninitialized access.
* src/smooth/ftgrays.c (gray_raster_render): Initialize
`ras.span_y'.
2015-01-14 Behdad Esfahbod <behdad@behdad.org>
[base] Don't initialize unused `driver->glyph_loader'.

View File

@ -1985,6 +1985,7 @@ typedef ptrdiff_t FT_PtrDist;
ras.invalid = 1;
ras.band_size = band_size;
ras.num_gray_spans = 0;
ras.span_y = 0;
if ( params->flags & FT_RASTER_FLAG_DIRECT )
{