Commit 30d3e85d authored by Havoc Pennington's avatar Havoc Pennington Committed by Havoc Pennington

remove bogus g_return_if_fail

2001-06-08  Havoc Pennington  <hp@redhat.com>

	* gdk-pixbuf-loader.c (gdk_pixbuf_loader_load_module): remove
	bogus g_return_if_fail

	* io-gif.c (gif_get_lzw): if delay time is 0 or smaller than
	likely timeout resolution, set it to an arbitrarily-chosen short
	delay.
	Fixes bug #55953 from warmenhoven@yahoo.com
parent 7009511a
2001-06-08 Havoc Pennington <hp@redhat.com>
* gdk-pixbuf-loader.c (gdk_pixbuf_loader_load_module): remove
bogus g_return_if_fail
* io-gif.c (gif_get_lzw): if delay time is 0 or smaller than
likely timeout resolution, set it to an arbitrarily-chosen short
delay.
Fixes bug #55953 from warmenhoven@yahoo.com
2001-06-07 Havoc Pennington <hp@redhat.com>
* Makefile.am: use Owen's new way of doing stampfiles/generated
......
......@@ -226,7 +226,6 @@ gdk_pixbuf_loader_load_module (GdkPixbufLoader *loader,
}
else
{
g_return_val_if_fail (priv->header_buf_offset > 0, 0);
priv->image_module = _gdk_pixbuf_get_module (priv->header_buf,
priv->header_buf_offset,
NULL,
......
......@@ -272,7 +272,7 @@ gdk_pixbuf_gif_anim_iter_advance (GdkPixbufAnimationIter *anim_iter,
elapsed =
(((iter->current_time.tv_sec - iter->start_time.tv_sec) * G_USEC_PER_SEC +
iter->current_time.tv_usec - iter->start_time.tv_usec)) / 1000;
if (elapsed < 0) {
/* Try to compensate; probably the system clock
* was set backwards
......@@ -280,14 +280,14 @@ gdk_pixbuf_gif_anim_iter_advance (GdkPixbufAnimationIter *anim_iter,
iter->start_time = iter->current_time;
elapsed = 0;
}
g_assert (iter->gif_anim->total_time > 0);
/* See how many times we've already played the full animation,
* and subtract time for that.
*/
elapsed = elapsed % iter->gif_anim->total_time;
g_assert (elapsed < iter->gif_anim->total_time);
iter->position = elapsed;
/* Now move to the proper frame */
......
......@@ -753,8 +753,17 @@ gif_get_lzw (GifContext *context)
/* GIF delay is in hundredths, we want thousandths */
context->frame->delay_time = context->gif89.delay_time * 10;
/* Some GIFs apparently have delay time of 0,
* that crashes everything so set it to "fast".
* Also, timeouts less than 20 or so just lock up
* the app or make the animation choppy, so fix them.
*/
if (context->frame->delay_time < 20)
context->frame->delay_time = 20; /* 20 = "fast" */
context->frame->elapsed = context->animation->total_time;
context->animation->total_time += context->frame->delay_time;
context->animation->total_time += context->frame->delay_time;
switch (context->gif89.disposal) {
case 0:
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment