[gzip] Fix access of small compressed files (#45937).
* src/gzip/ftgzip.c (ft_gzip_stream_close): Avoid memory leak. (ft_gzip_get_uncompressed_file): Correct byte order while reading unsigned long value. Without this change, the whole optimization of accessing small files in `FT_Stream_OpenGzip' is never executed! As a consequence, access to PCF files in general (which are normally small files) should be much improved now as originally intended.
This commit is contained in:
parent
db5a4a9ae7
commit
e40e8b33a1
12
ChangeLog
12
ChangeLog
|
@ -1,3 +1,15 @@
|
||||||
|
2015-09-13 Werner Lemberg <wl@gnu.org>
|
||||||
|
|
||||||
|
[gzip] Fix access of small compressed files (#45937).
|
||||||
|
|
||||||
|
* src/gzip/ftgzip.c (ft_gzip_stream_close): Avoid memory leak.
|
||||||
|
|
||||||
|
(ft_gzip_get_uncompressed_file): Correct byte order while reading
|
||||||
|
unsigned long value. Without this change, the whole optimization of
|
||||||
|
accessing small files in `FT_Stream_OpenGzip' is never executed! As
|
||||||
|
a consequence, access to PCF files in general (which are normally
|
||||||
|
small files) should be much improved now as originally intended.
|
||||||
|
|
||||||
2015-09-11 Werner Lemberg <wl@gnu.org>
|
2015-09-11 Werner Lemberg <wl@gnu.org>
|
||||||
|
|
||||||
[psaux] Fix potential buffer overflow (#45922).
|
[psaux] Fix potential buffer overflow (#45922).
|
||||||
|
|
|
@ -557,6 +557,9 @@
|
||||||
|
|
||||||
stream->descriptor.pointer = NULL;
|
stream->descriptor.pointer = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ( !stream->read )
|
||||||
|
FT_FREE( stream->base );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -584,7 +587,7 @@
|
||||||
old_pos = stream->pos;
|
old_pos = stream->pos;
|
||||||
if ( !FT_Stream_Seek( stream, stream->size - 4 ) )
|
if ( !FT_Stream_Seek( stream, stream->size - 4 ) )
|
||||||
{
|
{
|
||||||
result = FT_Stream_ReadULong( stream, &error );
|
result = FT_Stream_ReadULongLE( stream, &error );
|
||||||
if ( error )
|
if ( error )
|
||||||
result = 0;
|
result = 0;
|
||||||
|
|
||||||
|
@ -685,7 +688,7 @@
|
||||||
|
|
||||||
stream->size = 0x7FFFFFFFL; /* don't know the real size! */
|
stream->size = 0x7FFFFFFFL; /* don't know the real size! */
|
||||||
stream->pos = 0;
|
stream->pos = 0;
|
||||||
stream->base = 0;
|
stream->base = NULL;
|
||||||
stream->read = ft_gzip_stream_io;
|
stream->read = ft_gzip_stream_io;
|
||||||
stream->close = ft_gzip_stream_close;
|
stream->close = ft_gzip_stream_close;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue