guard against read zero bytes from libheif
This commit is contained in:
parent
1e015654c3
commit
b643bd9448
@ -874,8 +874,12 @@ vips_foreign_load_heif_read( void *data, size_t size, void *userdata )
|
|||||||
|
|
||||||
result = vips_source_read( heif->source, data, size );
|
result = vips_source_read( heif->source, data, size );
|
||||||
/* On EOF, make a note of the file length.
|
/* On EOF, make a note of the file length.
|
||||||
|
*
|
||||||
|
* libheif can sometimes ask for zero bytes, be careful not to
|
||||||
|
* interpret that as EOF.
|
||||||
*/
|
*/
|
||||||
if( result == 0 &&
|
if( size > 0 &&
|
||||||
|
result == 0 &&
|
||||||
heif->length == -1 )
|
heif->length == -1 )
|
||||||
result = heif->length =
|
result = heif->length =
|
||||||
vips_source_seek( heif->source, 0L, SEEK_CUR );
|
vips_source_seek( heif->source, 0L, SEEK_CUR );
|
||||||
|
Loading…
x
Reference in New Issue
Block a user