mirror of
https://gitlab.gnome.org/GNOME/gtk.git
synced 2024-11-05 16:20:10 +00:00
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
This commit is contained in:
parent
7009511a22
commit
30d3e85d96
@ -1,3 +1,13 @@
|
||||
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:
|
||||
|
Loading…
Reference in New Issue
Block a user