]> gitweb.michael.orlitzky.com - libsvgtiny-pixbuf.git/commitdiff
io-svg.c: do nothing if we're handed an increment of size zero
authorMichael Orlitzky <michael@orlitzky.com>
Mon, 7 Aug 2023 00:44:29 +0000 (20:44 -0400)
committerMichael Orlitzky <michael@orlitzky.com>
Mon, 7 Aug 2023 00:44:29 +0000 (20:44 -0400)
io-svg.c

index e44af1a5a87fbc0299799a169dd91e8622467c83..b1cb332f1aca74a059fea117f42eb91dcd126867 100644 (file)
--- a/io-svg.c
+++ b/io-svg.c
@@ -363,7 +363,10 @@ static gboolean gdk_pixbuf_load_increment(gpointer data,
                                           GError** error) {
   SvgTinyContext* context = (SvgTinyContext*)data;
 
-  /* YOLO, what is error checking? */
+  if (buf_size == 0) {
+    return TRUE;
+  }
+
   context->svg_data = g_realloc(context->svg_data,
                                 context->svg_data_size + buf_size);
   memcpy(context->svg_data + context->svg_data_size, buf, buf_size);