if (src_x == 0 || src_y == 0)
{
- g_warning ("invalid source position for bilinear gradient\n");
+ g_warning ("invalid source position for bilinear gradient");
return NULL;
}
result = gdk_pixbuf_new (GDK_COLORSPACE_RGB, n_channels == 4, 8,
width, height);
+
+ if (result == NULL)
+ {
+ g_warning ("failed to create a %dx%d pixbuf", width, height);
+ return NULL;
+ }
+
dest_rowstride = gdk_pixbuf_get_rowstride (result);
dest_pixels = gdk_pixbuf_get_pixels (result);
if (src_x == 0)
{
- g_warning ("invalid source position for horizontal gradient\n");
+ g_warning ("invalid source position for horizontal gradient");
return NULL;
}
result = gdk_pixbuf_new (GDK_COLORSPACE_RGB, n_channels == 4, 8,
width, height);
+
+ if (result == NULL)
+ {
+ g_warning ("failed to create a %dx%d pixbuf", width, height);
+ return NULL;
+ }
+
dest_rowstride = gdk_pixbuf_get_rowstride (result);
dest_pixels = gdk_pixbuf_get_pixels (result);
if (src_y == 0)
{
- g_warning ("invalid source position for vertical gradient\n");
+ g_warning ("invalid source position for vertical gradient");
return NULL;
}
result = gdk_pixbuf_new (GDK_COLORSPACE_RGB, n_channels == 4, 8,
width, height);
+
+ if (result == NULL)
+ {
+ g_warning ("failed to create a %dx%d pixbuf", width, height);
+ return NULL;
+ }
+
dest_rowstride = gdk_pixbuf_get_rowstride (result);
dest_pixels = gdk_pixbuf_get_pixels (result);
result = gdk_pixbuf_new (GDK_COLORSPACE_RGB, n_channels == 4, 8,
width, height);
+
+ if (result == NULL)
+ {
+ g_warning ("failed to create a %dx%d pixbuf", width, height);
+ return NULL;
+ }
+
dest_rowstride = gdk_pixbuf_get_rowstride (result);
dest_pixels = gdk_pixbuf_get_pixels (result);
result = gdk_pixbuf_new (GDK_COLORSPACE_RGB, n_channels == 4, 8,
width, height);
+
+ if (result == NULL)
+ {
+ g_warning ("failed to create a %dx%d pixbuf", width, height);
+ return NULL;
+ }
+
dest_rowstride = gdk_pixbuf_get_rowstride (result);
dest_pixels = gdk_pixbuf_get_pixels (result);
result = gdk_pixbuf_new (GDK_COLORSPACE_RGB, n_channels == 4, 8,
width, height);
+
+ if (result == NULL)
+ {
+ g_warning ("failed to create a %dx%d pixbuf", width, height);
+ return NULL;
+ }
+
dest_rowstride = gdk_pixbuf_get_rowstride (result);
dest_pixels = gdk_pixbuf_get_pixels (result);