mirror of
https://gitlab.gnome.org/GNOME/gtk.git
synced 2024-11-05 16:20:10 +00:00
applied JPEG loader fix from maemo. this fix makes sure stop_load()
Wed Mar 28 15:27:35 2007 Tim Janik <timj@imendio.com> * io-jpeg.c: applied JPEG loader fix from maemo. this fix makes sure stop_load() doesn't forget about its return value, and it pulls the check for infinite looping out of an else branch in load_increment() so it runs unconditionally, fixes #397643. svn path=/trunk/; revision=17567
This commit is contained in:
parent
1e2e601e5c
commit
8a78c744e1
@ -1,3 +1,10 @@
|
||||
Wed Mar 28 15:27:35 2007 Tim Janik <timj@imendio.com>
|
||||
|
||||
* io-jpeg.c: applied JPEG loader fix from maemo. this fix makes sure
|
||||
stop_load() doesn't forget about its return value, and it pulls the
|
||||
check for infinite looping out of an else branch in load_increment()
|
||||
so it runs unconditionally, fixes #397643.
|
||||
|
||||
2007-03-08 Matthias Clasen <mclasen@redhat.com>
|
||||
|
||||
* gdk-pixbuf-scaled-anim.[hc]: Implement an animation
|
||||
|
@ -518,6 +518,7 @@ static gboolean
|
||||
gdk_pixbuf__jpeg_image_stop_load (gpointer data, GError **error)
|
||||
{
|
||||
JpegProgContext *context = (JpegProgContext *) data;
|
||||
gboolean retval;
|
||||
|
||||
g_return_val_if_fail (context != NULL, TRUE);
|
||||
|
||||
@ -530,12 +531,14 @@ gdk_pixbuf__jpeg_image_stop_load (gpointer data, GError **error)
|
||||
|
||||
/* if we have an error? */
|
||||
if (sigsetjmp (context->jerr.setjmp_buffer, 1)) {
|
||||
jpeg_destroy_decompress (&context->cinfo);
|
||||
retval = FALSE;
|
||||
} else {
|
||||
jpeg_finish_decompress(&context->cinfo);
|
||||
jpeg_destroy_decompress(&context->cinfo);
|
||||
jpeg_finish_decompress (&context->cinfo);
|
||||
retval = TRUE;
|
||||
}
|
||||
|
||||
jpeg_destroy_decompress (&context->cinfo);
|
||||
|
||||
if (context->cinfo.src) {
|
||||
my_src_ptr src = (my_src_ptr) context->cinfo.src;
|
||||
|
||||
@ -544,7 +547,7 @@ gdk_pixbuf__jpeg_image_stop_load (gpointer data, GError **error)
|
||||
|
||||
g_free (context);
|
||||
|
||||
return TRUE;
|
||||
return retval;
|
||||
}
|
||||
|
||||
|
||||
@ -686,17 +689,17 @@ gdk_pixbuf__jpeg_image_load_increment (gpointer data,
|
||||
src->pub.bytes_in_buffer += num_copy;
|
||||
bufhd += num_copy;
|
||||
num_left -= num_copy;
|
||||
} else {
|
||||
/* did anything change from last pass, if not return */
|
||||
if (first) {
|
||||
last_bytes_left = src->pub.bytes_in_buffer;
|
||||
first = FALSE;
|
||||
} else if (src->pub.bytes_in_buffer == last_bytes_left)
|
||||
spinguard++;
|
||||
else
|
||||
last_bytes_left = src->pub.bytes_in_buffer;
|
||||
}
|
||||
|
||||
/* did anything change from last pass, if not return */
|
||||
if (first) {
|
||||
last_bytes_left = src->pub.bytes_in_buffer;
|
||||
first = FALSE;
|
||||
} else if (src->pub.bytes_in_buffer == last_bytes_left)
|
||||
spinguard++;
|
||||
else
|
||||
last_bytes_left = src->pub.bytes_in_buffer;
|
||||
|
||||
/* should not go through twice and not pull bytes out of buf */
|
||||
if (spinguard > 2)
|
||||
return TRUE;
|
||||
|
Loading…
Reference in New Issue
Block a user