summaryrefslogtreecommitdiff
path: root/gdk-pixbuf
diff options
context:
space:
mode:
authorTim Janik <timj@imendio.com>2007-03-28 13:29:17 +0000
committerTim Janik <timj@src.gnome.org>2007-03-28 13:29:17 +0000
commit8a78c744e10a9b4eb1702fba76fdbf3112a063fa (patch)
treead96fc13a82c05d4ce37453d1a4f703108476de0 /gdk-pixbuf
parent1e2e601e5cf5143ad520843924c441bfe4cf68c9 (diff)
downloadgdk-pixbuf-8a78c744e10a9b4eb1702fba76fdbf3112a063fa.tar.gz
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
Diffstat (limited to 'gdk-pixbuf')
-rw-r--r--gdk-pixbuf/ChangeLog7
-rw-r--r--gdk-pixbuf/io-jpeg.c29
2 files changed, 23 insertions, 13 deletions
diff --git a/gdk-pixbuf/ChangeLog b/gdk-pixbuf/ChangeLog
index eb3cbaa70..2b853f6cf 100644
--- a/gdk-pixbuf/ChangeLog
+++ b/gdk-pixbuf/ChangeLog
@@ -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
diff --git a/gdk-pixbuf/io-jpeg.c b/gdk-pixbuf/io-jpeg.c
index cd11ebc9c..462a99d1d 100644
--- a/gdk-pixbuf/io-jpeg.c
+++ b/gdk-pixbuf/io-jpeg.c
@@ -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;