summaryrefslogtreecommitdiff
path: root/gdk-pixbuf/io-jpeg.c
diff options
context:
space:
mode:
Diffstat (limited to 'gdk-pixbuf/io-jpeg.c')
-rw-r--r--gdk-pixbuf/io-jpeg.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/gdk-pixbuf/io-jpeg.c b/gdk-pixbuf/io-jpeg.c
index 3b0a1623c..96f993f40 100644
--- a/gdk-pixbuf/io-jpeg.c
+++ b/gdk-pixbuf/io-jpeg.c
@@ -1402,6 +1402,12 @@ real_save_jpeg (GdkPixbuf *pixbuf,
h = gdk_pixbuf_get_height (pixbuf);
pixels = gdk_pixbuf_get_pixels (pixbuf);
+ /* Guaranteed by the caller. */
+ g_assert (w >= 0);
+ g_assert (h >= 0);
+ g_assert (rowstride >= 0);
+ g_assert (n_channels >= 0);
+
/* Allocate a small buffer to convert image data,
* and a larger buffer if doing to_callback save.
*/