File gdk-pixbuf-CVE_2021-44648.patch of Package gdk-pixbuf.25775

diff -urpN gdk-pixbuf-2.40.0.orig/gdk-pixbuf/io-gif.c gdk-pixbuf-2.40.0/gdk-pixbuf/io-gif.c
--- gdk-pixbuf-2.40.0.orig/gdk-pixbuf/io-gif.c	2019-10-08 05:44:10.000000000 -0500
+++ gdk-pixbuf-2.40.0/gdk-pixbuf/io-gif.c	2022-08-30 12:56:27.611255971 -0500
@@ -554,8 +554,8 @@ gif_prepare_lzw (GifContext *context)
 		/*g_message (_("GIF: EOF / read error on image data\n"));*/
 		return -1;
 	}
-        
-        if (context->lzw_set_code_size > 12) {
+
+        if (context->lzw_set_code_size >= 12) {
                 g_set_error_literal (context->error,
                                      GDK_PIXBUF_ERROR,
                                      GDK_PIXBUF_ERROR_CORRUPT_IMAGE,
diff -urpN gdk-pixbuf-2.40.0.orig/gdk-pixbuf/lzw.c gdk-pixbuf-2.40.0/gdk-pixbuf/lzw.c
--- gdk-pixbuf-2.40.0.orig/gdk-pixbuf/lzw.c	2019-10-08 05:44:10.000000000 -0500
+++ gdk-pixbuf-2.40.0/gdk-pixbuf/lzw.c	2022-08-30 12:56:22.599229504 -0500
@@ -121,6 +121,8 @@ lzw_decoder_new (guint8 code_size)
         LZWDecoder *self;
         int i;
 
+        g_return_val_if_fail (code_size <= LZW_CODE_MAX, NULL);
+
         self = g_object_new (lzw_decoder_get_type (), NULL);
 
         self->min_code_size = code_size;
diff -urpN gdk-pixbuf-2.40.0.orig/tests/test-images/gif-test-suite/invalid-code.conf gdk-pixbuf-2.40.0/tests/test-images/gif-test-suite/invalid-code.conf
--- gdk-pixbuf-2.40.0.orig/tests/test-images/gif-test-suite/invalid-code.conf	1969-12-31 18:00:00.000000000 -0600
+++ gdk-pixbuf-2.40.0/tests/test-images/gif-test-suite/invalid-code.conf	2022-08-30 12:56:32.399281257 -0500
@@ -0,0 +1,11 @@
+# Automatically generated, do not edit!
+[config]
+input = invalid-code.gif
+version = GIF89a
+width = 2
+height = 2
+background = #000000
+loop-count = 0
+force-animation = no
+frames = 
+
diff -urpN gdk-pixbuf-2.40.0.orig/tests/test-images/gif-test-suite/overflow-codes.conf gdk-pixbuf-2.40.0/tests/test-images/gif-test-suite/overflow-codes.conf
--- gdk-pixbuf-2.40.0.orig/tests/test-images/gif-test-suite/overflow-codes.conf	1969-12-31 18:00:00.000000000 -0600
+++ gdk-pixbuf-2.40.0/tests/test-images/gif-test-suite/overflow-codes.conf	2022-08-30 12:56:32.399281257 -0500
@@ -0,0 +1,11 @@
+# Automatically generated, do not edit!
+[config]
+input = overflow-codes.gif
+version = GIF89a
+width = 2
+height = 2
+background = #000000
+loop-count = 0
+force-animation = no
+frames = 
+
diff -urpN gdk-pixbuf-2.40.0.orig/tests/test-images/gif-test-suite/overflow-codes-max.conf gdk-pixbuf-2.40.0/tests/test-images/gif-test-suite/overflow-codes-max.conf
--- gdk-pixbuf-2.40.0.orig/tests/test-images/gif-test-suite/overflow-codes-max.conf	1969-12-31 18:00:00.000000000 -0600
+++ gdk-pixbuf-2.40.0/tests/test-images/gif-test-suite/overflow-codes-max.conf	2022-08-30 12:56:32.399281257 -0500
@@ -0,0 +1,11 @@
+# Automatically generated, do not edit!
+[config]
+input = overflow-codes-max.gif
+version = GIF89a
+width = 2
+height = 2
+background = #000000
+loop-count = 0
+force-animation = no
+frames = 
+
diff -urpN gdk-pixbuf-2.40.0.orig/tests/test-images/gif-test-suite/TESTS gdk-pixbuf-2.40.0/tests/test-images/gif-test-suite/TESTS
--- gdk-pixbuf-2.40.0.orig/tests/test-images/gif-test-suite/TESTS	2019-10-08 05:44:10.000000000 -0500
+++ gdk-pixbuf-2.40.0/tests/test-images/gif-test-suite/TESTS	2022-08-30 12:56:32.399281257 -0500
@@ -44,6 +44,8 @@ max-height
 255-codes
 large-codes
 max-codes
+#overflow-codes
+#overflow-codes-max
 transparent
 invalid-transparent
 disabled-transparent
openSUSE Build Service is sponsored by