now handle arbitrary buffer sizes.

1999-11-03  Jonathan Blandford  <jrb@redhat.com>

	* src/io-gif.c (image_load_increment): now handle arbitrary buffer
	sizes.
This commit is contained in:
Jonathan Blandford 1999-11-03 21:52:16 +00:00 committed by Jonathan Blandford
parent 0b0e66db4b
commit 677a78b56a
2 changed files with 7 additions and 2 deletions

View File

@ -1,3 +1,8 @@
1999-11-03 Jonathan Blandford <jrb@redhat.com>
* src/io-gif.c (image_load_increment): now handle arbitrary buffer
sizes.
1999-11-03 Federico Mena Quintero <federico@redhat.com>
* src/gnome-canvas-pixbuf.c (gnome_canvas_pixbuf_init):

View File

@ -184,7 +184,7 @@ ReadOK (GifContext *context, guchar *buffer, size_t len)
#endif
if ((context->size - context->ptr) >= len) {
count += len;
memcpy (buffer, context->buf + context->ptr, len);
memmove (buffer, context->buf + context->ptr, len);
context->ptr += len;
context->amount_needed = 0;
#ifdef IO_GIFDEBUG
@ -1030,7 +1030,7 @@ image_load_increment (gpointer data, guchar *buf, guint size)
} else {
/* copy the left overs to the begining of the buffer */
/* and realloc the memory */
memcpy (context->buf, context->buf, context->size - context->ptr);
memmove (context->buf, context->buf + context->ptr, context->size - context->ptr);
context->buf = g_realloc (context->buf, context->amount_needed + (context->size - context->ptr));
}
context->size = context->size - context->ptr;