Description: Prevent crashing when copying very small parts (like 40x1)
Author: Michael Natterer
Origin: upstream, https://gitlab.gnome.org/GNOME/gimp/-/commit/64f45df6ce6
Bug-Ubuntu: https://bugs.launchpad.net/bugs/2061698
---
--- a/app/core/gimppattern.c
+++ b/app/core/gimppattern.c
@@ -171,6 +171,9 @@ gimp_pattern_get_new_preview (GimpViewab
       else if (true_width < true_height)
         copy_width = copy_height * aspect;
 
+      copy_width  = MAX (1, copy_width);
+      copy_height = MAX (1, copy_height);
+
       temp_buf = gimp_temp_buf_new (copy_width, copy_height,
                                     gimp_temp_buf_get_format (pattern->mask));
 
