From e698af035a8d9363ac6d212a8e986e1f4fdac969 Mon Sep 17 00:00:00 2001 From: ManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com> Date: Mon, 20 Jun 2022 12:49:38 +0200 Subject: Fix issue #427 - 2nd part Fix Fl_Tiled_Image made from scaled source image. Fix Fl_Shared_Image::update() to allow scaled source image. Correct handling of default value (-1) of 3rd argument of 3-argument Fl_BMP_Image constructor. --- src/Fl_BMP_Image.cxx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/Fl_BMP_Image.cxx') diff --git a/src/Fl_BMP_Image.cxx b/src/Fl_BMP_Image.cxx index 8b326ede4..de444f99b 100644 --- a/src/Fl_BMP_Image.cxx +++ b/src/Fl_BMP_Image.cxx @@ -103,7 +103,8 @@ Fl_BMP_Image::Fl_BMP_Image(const char *imagename, const unsigned char *data, con : Fl_RGB_Image(0,0,0) { Fl_Image_Reader rdr; - if (rdr.open(imagename, data, length) == -1) { + int retval = (length < 0 ? rdr.open(imagename, data) : rdr.open(imagename, data, (size_t)length)); + if (retval == -1) { ld(ERR_FILE_ACCESS); } else { load_bmp_(rdr); -- cgit v1.2.3