DO NOT REPLY TO THIS MESSAGE.  INSTEAD, POST ANY RESPONSES TO THE LINK BELOW.

[STR New]

Link: http://www.fltk.org/str.php?L2884
Version: 1.3.0


Hi, I have found a bug when creating Fl_PNG_Image from static memory area
using:
Fl_PNG_Image (const char *name_png, const unsigned char *buffer, int
datasize)

The image is added into Fl_Shared_Image list with predefined name
"In-memory PNG data" instead of the name supplied to the constructor. This
way the image can not be used in Fl_Help_Browser.

The fix would be:
---
  int from_memory = (buffer_png != NULL); // true if reading image from
memory

  if (!from_memory) {
    if ((fp = fl_fopen(name_png, "rb")) == NULL) return;
  }
-  else name_png = "In-memory PNG data";
+  else if( !name_png ) name_png = "In-memory PNG data";

  // Setup the PNG data structures...
  pp = png_create_read_struct(PNG_LIBPNG_VER_STRING, NULL, NULL, NULL);
  if (pp) info = png_create_info_struct(pp);
  if (!pp || !info) {
----


Link: http://www.fltk.org/str.php?L2884
Version: 1.3.0

_______________________________________________
fltk-bugs mailing list
[email protected]
http://lists.easysw.com/mailman/listinfo/fltk-bugs

Reply via email to