From 0f8649f3c4e4307518b451ec44ecfa5eff3074c0 Mon Sep 17 00:00:00 2001 From: ManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com> Date: Tue, 5 Mar 2024 19:02:27 +0100 Subject: Filechooser preview of XML file shows it as a corrupt image - cont'd (#926) --- src/fl_images_core.cxx | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/fl_images_core.cxx b/src/fl_images_core.cxx index 45835fa20..de34fe3e9 100644 --- a/src/fl_images_core.cxx +++ b/src/fl_images_core.cxx @@ -126,12 +126,22 @@ fl_check_images(const char *name, // I - Filename // SVG or SVGZ (gzip'ed SVG) #ifdef FLTK_USE_SVG - uchar header2[300]; // buffer for decompression + uchar header2[300]; // buffer for decompression uchar *buf = header; // original header data int count = headerlen; // original header data size // Note: variables 'buf' and 'count' may be overwritten subsequently - // if the image data is gzip'ed *and* we can decompress the data + // if the image data is xml or gzip'ed *and* we can decompress the data + + if (count >= 5 && memcmp(header, "= 4 && memcmp(buf, "= 5 && memcmp(buf, "