Index: gmic-1.6.5.0/src/CImg.h =================================================================== --- gmic-1.6.5.0.orig/src/CImg.h +++ gmic-1.6.5.0/src/CImg.h @@ -49065,9 +49065,9 @@ namespace cimg_library_suffixed { filename?filename:"(FILE*)"); #endif std::FILE *const nfile = file?file:cimg::fopen(filename,"wb"); const char *const ptype = pixel_type(), *const etype = cimg::endianness()?"big":"little"; - if (std::strstr(ptype,"unsigned")==ptype) std::fprintf(nfile,"%u unsigned_%s %s_endian\n",_width,ptype + 9,etype); + if (std::strlen(ptype) > 9 && std::strstr(ptype,"unsigned")==ptype) std::fprintf(nfile,"%u unsigned_%s %s_endian\n",_width,ptype + 9,etype); else std::fprintf(nfile,"%u %s %s_endian\n",_width,ptype,etype); cimglist_for(*this,l) { const CImg& img = _data[l]; std::fprintf(nfile,"%u %u %u %u",img._width,img._height,img._depth,img._spectrum); @@ -49615,9 +49615,9 @@ namespace cimg_library_suffixed { #endif CImgList stream; CImg tmpstr(128); const char *const ptype = pixel_type(), *const etype = cimg::endianness()?"big":"little"; - if (std::strstr(ptype,"unsigned")==ptype) + if (std::strlen(ptype) > 9 && std::strstr(ptype,"unsigned")==ptype) cimg_snprintf(tmpstr,tmpstr._width,"%u unsigned_%s %s_endian\n",_width,ptype + 9,etype); else cimg_snprintf(tmpstr,tmpstr._width,"%u %s %s_endian\n",_width,ptype,etype); CImg::string(tmpstr,false).move_to(stream);