Fix the spinguard logic for big buffers. (#494667, Ed Catmur)
2007-12-09 Matthias Clasen <mclasen@redhat.com> * io-jpeg.c: Fix the spinguard logic for big buffers. (#494667, Ed Catmur) svn path=/trunk/; revision=19135
This commit is contained in:
committed by
Matthias Clasen
parent
6f19a46cf9
commit
2943543c1b
@ -1,3 +1,8 @@
|
|||||||
|
2007-12-09 Matthias Clasen <mclasen@redhat.com>
|
||||||
|
|
||||||
|
* io-jpeg.c: Fix the spinguard logic for big buffers.
|
||||||
|
(#494667, Ed Catmur)
|
||||||
|
|
||||||
2007-11-25 Tor Lillqvist <tml@novell.com>
|
2007-11-25 Tor Lillqvist <tml@novell.com>
|
||||||
|
|
||||||
* Makefile.am: Fix static build of the icns loader.
|
* Makefile.am: Fix static build of the icns loader.
|
||||||
|
|||||||
@ -812,7 +812,7 @@ gdk_pixbuf__jpeg_image_load_increment (gpointer data,
|
|||||||
struct jpeg_decompress_struct *cinfo;
|
struct jpeg_decompress_struct *cinfo;
|
||||||
my_src_ptr src;
|
my_src_ptr src;
|
||||||
guint num_left, num_copy;
|
guint num_left, num_copy;
|
||||||
guint last_bytes_left;
|
guint last_num_left, last_bytes_left;
|
||||||
guint spinguard;
|
guint spinguard;
|
||||||
gboolean first;
|
gboolean first;
|
||||||
const guchar *bufhd;
|
const guchar *bufhd;
|
||||||
@ -853,6 +853,7 @@ gdk_pixbuf__jpeg_image_load_increment (gpointer data,
|
|||||||
if (num_left == 0)
|
if (num_left == 0)
|
||||||
return TRUE;
|
return TRUE;
|
||||||
|
|
||||||
|
last_num_left = num_left;
|
||||||
last_bytes_left = 0;
|
last_bytes_left = 0;
|
||||||
spinguard = 0;
|
spinguard = 0;
|
||||||
first = TRUE;
|
first = TRUE;
|
||||||
@ -880,10 +881,13 @@ gdk_pixbuf__jpeg_image_load_increment (gpointer data,
|
|||||||
if (first) {
|
if (first) {
|
||||||
last_bytes_left = src->pub.bytes_in_buffer;
|
last_bytes_left = src->pub.bytes_in_buffer;
|
||||||
first = FALSE;
|
first = FALSE;
|
||||||
} else if (src->pub.bytes_in_buffer == last_bytes_left)
|
} else if (src->pub.bytes_in_buffer == last_bytes_left
|
||||||
|
&& num_left == last_num_left) {
|
||||||
spinguard++;
|
spinguard++;
|
||||||
else
|
} else {
|
||||||
last_bytes_left = src->pub.bytes_in_buffer;
|
last_bytes_left = src->pub.bytes_in_buffer;
|
||||||
|
last_num_left = num_left;
|
||||||
|
}
|
||||||
|
|
||||||
/* should not go through twice and not pull bytes out of buf */
|
/* should not go through twice and not pull bytes out of buf */
|
||||||
if (spinguard > 2)
|
if (spinguard > 2)
|
||||||
|
|||||||
Reference in New Issue
Block a user