summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--libmate-desktop/mate-thumbnail-pixbuf-utils.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/libmate-desktop/mate-thumbnail-pixbuf-utils.c b/libmate-desktop/mate-thumbnail-pixbuf-utils.c
index b568650..0252c2d 100644
--- a/libmate-desktop/mate-thumbnail-pixbuf-utils.c
+++ b/libmate-desktop/mate-thumbnail-pixbuf-utils.c
@@ -157,9 +157,15 @@ mate_desktop_thumbnail_scale_down_pixbuf (GdkPixbuf *pixbuf,
*dest++ = 0;
}
} else {
- *dest++ = r / n_pixels;
- *dest++ = g / n_pixels;
- *dest++ = b / n_pixels;
+ if (n_pixels != 0) {
+ *dest++ = r / n_pixels;
+ *dest++ = g / n_pixels;
+ *dest++ = b / n_pixels;
+ } else {
+ *dest++ = 0;
+ *dest++ = 0;
+ *dest++ = 0;
+ }
}
s_x1 = s_x2;