forgot to advance the buffer pointers

thanks kleis

see https://github.com/kleisauke/net-vips/issues/101#issuecomment-726046152
This commit is contained in:
John Cupitt 2020-11-12 12:32:51 +00:00
parent 2dd6fc1f36
commit a09027b2a5
2 changed files with 6 additions and 4 deletions

View File

@ -964,13 +964,14 @@ vips_foreign_load_heif_read( void *data, size_t size, void *userdata )
VipsForeignLoadHeif *heif = (VipsForeignLoadHeif *) userdata; VipsForeignLoadHeif *heif = (VipsForeignLoadHeif *) userdata;
while( size > 0 ) { while( size > 0 ) {
gint64 result; gint64 bytes_read;
result = vips_source_read( heif->source, data, size ); bytes_read = vips_source_read( heif->source, data, size );
if( result <= 0 ) if( bytes_read <= 0 )
return( -1 ); return( -1 );
size -= result; size -= bytes_read;
data += bytes_read;
} }
return( 0 ); return( 0 );

View File

@ -473,6 +473,7 @@ vips_foreign_load_ppm_generate_binary( VipsRegion *or,
} }
n_bytes -= bytes_read; n_bytes -= bytes_read;
q += bytes_read;
} }
} }