aboutsummaryrefslogtreecommitdiffstats
path: root/main/gdk-pixbuf/CVE-2017-6314.patch
blob: a345fe03fd8919599f11ca15efe4da0e24ab7afb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
--- gdk-pixbuf-2.30.8/gdk-pixbuf/io-tiff.c	
+++ gdk-pixbuf-2.30.8/gdk-pixbuf/io-tiff.c	
@@ -458,9 +458,12 @@ make_available_at_least (TiffContext *co
         need_alloc = context->used + needed;
         if (need_alloc > context->allocated) {
                 guint new_size = 1;
-                while (new_size < need_alloc)
+                while (new_size && (new_size < need_alloc))
                         new_size *= 2;
 
+		if(!(new_size))
+			return FALSE;
+
                 new_buffer = g_try_realloc (context->buffer, new_size);
                 if (new_buffer) {
                         context->buffer = new_buffer;