Re: inline pixbufs



Federico Mena Quintero <federico@helixcode.com> writes:
> Havoc Pennington <hp@redhat.com> writes:
> 
> > +        if (rowstride < width)
> > +                return NULL; /* bad data from untrusted source. */
> 
> This does not handle bits_per_pixel != 8.
>

Explain in more detail. ;-) What are rowstride and width in that case?
 
> 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.
> 

Mhm, I like forcing them to think about the "copy_pixels" issue. Plus,
the above is sort of inconvenient.

Havoc





[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]