From 72840ea2c12c41b36aff623b18f9c219ae085da3 Mon Sep 17 00:00:00 2001 From: ManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com> Date: Mon, 4 Mar 2024 21:15:47 +0100 Subject: Fix: Filechooser preview of XML file shows it as a corrupt image (#926) --- src/fl_images_core.cxx | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) (limited to 'src') diff --git a/src/fl_images_core.cxx b/src/fl_images_core.cxx index 431e7c98c..45835fa20 100644 --- a/src/fl_images_core.cxx +++ b/src/fl_images_core.cxx @@ -36,6 +36,7 @@ #include #include #include +#include #include "flstring.h" #if defined(HAVE_LIBZ) #include @@ -125,7 +126,7 @@ fl_check_images(const char *name, // I - Filename // SVG or SVGZ (gzip'ed SVG) #ifdef FLTK_USE_SVG - uchar header2[64]; // buffer for decompression + uchar header2[300]; // buffer for decompression uchar *buf = header; // original header data int count = headerlen; // original header data size @@ -158,11 +159,18 @@ fl_check_images(const char *name, // I - Filename } // Check svg or xml signature - - if ((count >= 5 && - (memcmp(buf, "