Re: inline pixbufs
- From: Federico Mena Quintero <federico helixcode com>
- To: Havoc Pennington <hp redhat com>
- Cc: Darin Adler <darin eazel com>, <gtk-devel-list gnome org>
- Subject: Re: inline pixbufs
- Date: 26 Jul 2000 17:13:44 -0400
Havoc Pennington <hp@redhat.com> writes:
> + if (rowstride < width)
> + return NULL; /* bad data from untrusted source. */
This does not handle bits_per_pixel != 8.
> + if (bits_per_sample != 8)
> + return NULL;
So maybe you should move this upwards :-)
> +GdkPixbuf*
> +gdk_pixbuf_new_from_inline (const guchar *inline_pixbuf,
> + gboolean copy_pixels,
> + int length)
We should lose the copy_pixels. People can just do
GdkPixbuf *p1, *p2;
p1 = gdk_pixbuf_new_from_inline (inline_data, -1);
p2 = gdk_pixbuf_copy (p1);
gdk_pixbuf_unref (p1);
if they want a read/write pixbuf or if they are getting the inline
data from the Bonobo pipe. Besides, gdk_pixbuf_copy() can be smarter
about compressing/expanding rowstrides and there is no reason to
duplicate that functionality. The idea is that pixbufs are read-only
unless you know what you are doing.
Federico
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]