diff --git a/gdk-pixbuf/ChangeLog b/gdk-pixbuf/ChangeLog index 3e7dc8ac1c..f2679bcc28 100644 --- a/gdk-pixbuf/ChangeLog +++ b/gdk-pixbuf/ChangeLog @@ -1,5 +1,10 @@ 2006-12-21 Matthias Clasen + * gdk-pixbuf-data.c (gdk_pixbuf_new_from_data): + * gdk-pixbuf.c (gdk_pixbuf_new): Remove redundant size + checks, and document that width, height must be > 0. + (#343330, Felix Riemann) + * Makefile.am: Link against GLib. (#341158, Alexey Rusakov) 2006-12-19 Matthias Clasen diff --git a/gdk-pixbuf/gdk-pixbuf-data.c b/gdk-pixbuf/gdk-pixbuf-data.c index 43fd9c1d3d..16b7d9b97a 100644 --- a/gdk-pixbuf/gdk-pixbuf-data.c +++ b/gdk-pixbuf/gdk-pixbuf-data.c @@ -31,16 +31,16 @@ /** * gdk_pixbuf_new_from_data: - * @data: Image data in 8-bit/sample packed format. - * @colorspace: Colorspace for the image data. - * @has_alpha: Whether the data has an opacity channel. - * @bits_per_sample: Number of bits per sample. - * @width: Width of the image in pixels. - * @height: Height of the image in pixels. - * @rowstride: Distance in bytes between row starts. + * @data: Image data in 8-bit/sample packed format + * @colorspace: Colorspace for the image data + * @has_alpha: Whether the data has an opacity channel + * @bits_per_sample: Number of bits per sample + * @width: Width of the image in pixels, must be > 0 + * @height: Height of the image in pixels, must be > 0 + * @rowstride: Distance in bytes between row starts * @destroy_fn: Function used to free the data when the pixbuf's reference count - * drops to zero, or %NULL if the data should not be freed. - * @destroy_fn_data: Closure data to pass to the destroy notification function. + * drops to zero, or %NULL if the data should not be freed + * @destroy_fn_data: Closure data to pass to the destroy notification function * * Creates a new #GdkPixbuf out of in-memory image data. Currently only RGB * images with 8 bits per sample are supported. diff --git a/gdk-pixbuf/gdk-pixbuf.c b/gdk-pixbuf/gdk-pixbuf.c index 42c91887b5..a582733229 100644 --- a/gdk-pixbuf/gdk-pixbuf.c +++ b/gdk-pixbuf/gdk-pixbuf.c @@ -224,11 +224,11 @@ free_buffer (guchar *pixels, gpointer data) /** * gdk_pixbuf_new: - * @colorspace: Color space for image. - * @has_alpha: Whether the image should have transparency information. - * @bits_per_sample: Number of bits per color sample. - * @width: Width of image in pixels. - * @height: Height of image in pixels. + * @colorspace: Color space for image + * @has_alpha: Whether the image should have transparency information + * @bits_per_sample: Number of bits per color sample + * @width: Width of image in pixels, must be > 0 + * @height: Height of image in pixels, must be > 0 * * Creates a new #GdkPixbuf structure and allocates a buffer for it. The * buffer has an optimal rowstride. Note that the buffer is not cleared; @@ -254,9 +254,6 @@ gdk_pixbuf_new (GdkColorspace colorspace, g_return_val_if_fail (width > 0, NULL); g_return_val_if_fail (height > 0, NULL); - if (width <= 0 || height <= 0) - return NULL; - channels = has_alpha ? 4 : 3; rowstride = width * channels; if (rowstride / channels != width || rowstride + 3 < 0) /* overflow */