handle eof better for buffer GIF
Add the new eof handling to the memory reader.
This commit is contained in:
parent
1ac96313cc
commit
6c525e144b
@ -1263,14 +1263,17 @@ G_DEFINE_TYPE( VipsForeignLoadGifBuffer, vips_foreign_load_gif_buffer,
|
||||
static int
|
||||
vips_giflib_buffer_read( GifFileType *file, GifByteType *buf, int n )
|
||||
{
|
||||
VipsForeignLoadGifBuffer *buffer =
|
||||
(VipsForeignLoadGifBuffer *) file->UserData;
|
||||
VipsForeignLoadGif *gif = (VipsForeignLoadGif *) file->UserData;
|
||||
VipsForeignLoadGifBuffer *buffer = (VipsForeignLoadGifBuffer *) gif;
|
||||
size_t will_read = VIPS_MIN( n, buffer->bytes_to_go );
|
||||
|
||||
memcpy( buf, buffer->p, will_read );
|
||||
buffer->p += will_read;
|
||||
buffer->bytes_to_go -= will_read;
|
||||
|
||||
if( will_read == 0 )
|
||||
gif->eof = TRUE;
|
||||
|
||||
return( will_read );
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user