Accept xbms starting with a C comment - those seem to be not uncommon,
* gdk-pixbuf-io.c (pixbuf_check_xbm): Accept xbms starting with a C comment - those seem to be not uncommon, e.g. the Gimp produces them. (#82706) * io-xbm.c (read_bitmap_file_data): Don't leak memory on certain invalid inputs. (gdk_pixbuf__xbm_image_load_real): Don't leak memory on valid inputs.
This commit is contained in:
@@ -1,3 +1,13 @@
|
|||||||
|
2002-06-01 Matthias Clasen <maclas@gmx.de>
|
||||||
|
|
||||||
|
* gdk-pixbuf-io.c (pixbuf_check_xbm): Accept xbms starting
|
||||||
|
with a C comment - those seem to be not uncommon, e.g. the Gimp
|
||||||
|
produces them. (#82706)
|
||||||
|
|
||||||
|
* io-xbm.c (read_bitmap_file_data): Don't leak memory on certain
|
||||||
|
invalid inputs.
|
||||||
|
(gdk_pixbuf__xbm_image_load_real): Don't leak memory on valid inputs.
|
||||||
|
|
||||||
2002-05-22 Tor Lillqvist <tml@iki.fi>
|
2002-05-22 Tor Lillqvist <tml@iki.fi>
|
||||||
|
|
||||||
* gdk-pixbuf-io.c (get_libdir): Use GTK_BINARY_VERSION (and not
|
* gdk-pixbuf-io.c (get_libdir): Use GTK_BINARY_VERSION (and not
|
||||||
|
|||||||
@@ -193,17 +193,22 @@ pixbuf_check_xbm (guchar *buffer, int size)
|
|||||||
if (size < 20)
|
if (size < 20)
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
||||||
if (buffer [0] != '#'
|
if (buffer [0] == '#'
|
||||||
|| buffer [1] != 'd'
|
&& buffer [1] == 'd'
|
||||||
|| buffer [2] != 'e'
|
&& buffer [2] == 'e'
|
||||||
|| buffer [3] != 'f'
|
&& buffer [3] == 'f'
|
||||||
|| buffer [4] != 'i'
|
&& buffer [4] == 'i'
|
||||||
|| buffer [5] != 'n'
|
&& buffer [5] == 'n'
|
||||||
|| buffer [6] != 'e'
|
&& buffer [6] == 'e'
|
||||||
|| buffer [7] != ' ')
|
&& buffer [7] == ' ')
|
||||||
return FALSE;
|
return TRUE;
|
||||||
|
|
||||||
return TRUE;
|
/* Note that this requires xpm to be checked before xbm. */
|
||||||
|
if (buffer [0] == '/'
|
||||||
|
&& buffer [1] != '*')
|
||||||
|
return TRUE;
|
||||||
|
|
||||||
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
static gboolean
|
static gboolean
|
||||||
|
|||||||
@@ -244,6 +244,7 @@ read_bitmap_file_data (FILE *fstream,
|
|||||||
*ptr=value;
|
*ptr=value;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!bits)
|
if (!bits)
|
||||||
@@ -323,6 +324,7 @@ gdk_pixbuf__xbm_image_load_real (FILE *f, XBMData *context, GError **error)
|
|||||||
}
|
}
|
||||||
pixels += row_stride;
|
pixels += row_stride;
|
||||||
}
|
}
|
||||||
|
g_free (data);
|
||||||
|
|
||||||
if (context) {
|
if (context) {
|
||||||
(* context->update_func) (pixbuf, 0, 0, w, h, context->user_data);
|
(* context->update_func) (pixbuf, 0, 0, w, h, context->user_data);
|
||||||
|
|||||||
Reference in New Issue
Block a user