summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobert Ancell <robert.ancell@canonical.com>2022-02-02 12:38:45 +1300
committerRobert Ancell <robert.ancell@canonical.com>2022-02-02 12:38:45 +1300
commit0cf97225c9c227d11fc4ddf9cba8e8480672ee1b (patch)
tree2c9243ebd3889b1a202492c8212b2de32433deb4
parent76eda67dbc3f48c9dd6815a5aaf6014ea4a16771 (diff)
downloadgdk-pixbuf-0cf97225c9c227d11fc4ddf9cba8e8480672ee1b.tar.gz
Add an assertion that checks for maximum LZW code size
-rw-r--r--gdk-pixbuf/lzw.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/gdk-pixbuf/lzw.c b/gdk-pixbuf/lzw.c
index 105daf2b1..15293560b 100644
--- a/gdk-pixbuf/lzw.c
+++ b/gdk-pixbuf/lzw.c
@@ -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;