File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -56646,7 +56646,10 @@ namespace cimg_library {
5664656646 (long)fsiz,filename?filename:"(FILE*)",dx,dy);
5664756647
5664856648 CImg<intT> colormap;
56649- if (bpp<16) { if (!nb_colors) nb_colors = 1<<bpp; } else nb_colors = 0;
56649+ if (bpp<16) {
56650+ const int max_colors = 1<<bpp;
56651+ if (nb_colors<=0 || nb_colors>max_colors) nb_colors = max_colors;
56652+ } else nb_colors = 0;
5665056653 if (nb_colors) { colormap.assign(nb_colors); cimg::fread(colormap._data,nb_colors,nfile); }
5665156654
5665256655 const int xoffset = offset - 14 - header_size - 4*nb_colors;
@@ -57422,7 +57425,7 @@ namespace cimg_library {
5742257425
5742357426 if (filename) { // Check that dimensions specified in file does not exceed the buffer dimension
5742457427 const cimg_int64 siz = cimg::fsize(filename);
57425- if (W*H*D>siz)
57428+ if ((cimg_int64) W*H*D>siz)
5742657429 throw CImgIOException(_cimg_instance
5742757430 "load_pnm(): Specified image dimensions in file '%s' exceed file size.",
5742857431 cimg_instance,
Original file line number Diff line number Diff line change 1616 < div class ="header ">
1717< a href ="index.html "> < img alt ="Logo " src ="img/logo_header.jpg " class ="center_image " style ="margin-top:1em; "/> </ a >
1818 < h2 style ="padding-bottom: 1em ">
19- Latest stable version: < b > < a href ="http://cimg.eu/files/CImg_3.7.4.zip "> 3.7.4</ a > </ b > Current pre-release: < b > < a href ="http://cimg.eu/files/CImg_latest.zip "> 3.7.5</ a > </ b > (2026/04/08 )
19+ Latest stable version: < b > < a href ="http://cimg.eu/files/CImg_3.7.4.zip "> 3.7.4</ a > </ b > Current pre-release: < b > < a href ="http://cimg.eu/files/CImg_latest.zip "> 3.7.5</ a > </ b > (2026/04/10 )
2020 </ h2 >
2121
2222 < hr />
Original file line number Diff line number Diff line change 2626 < div class ="header ">
2727< a href ="../index.html "> < img alt ="Logo " src ="../img/logo_header.jpg " class ="center_image " style ="margin-top:1em; "/> </ a >
2828 < h2 style ="padding-bottom: 1em ">
29- Latest stable version: < b > < a href ="http://cimg.eu/files/CImg_3.7.4.zip "> 3.7.4</ a > </ b > Current pre-release: < b > < a href ="http://cimg.eu/files/CImg_latest.zip "> 3.7.5</ a > </ b > (2026/04/08 )
29+ Latest stable version: < b > < a href ="http://cimg.eu/files/CImg_3.7.4.zip "> 3.7.4</ a > </ b > Current pre-release: < b > < a href ="http://cimg.eu/files/CImg_latest.zip "> 3.7.5</ a > </ b > (2026/04/10 )
3030 </ h2 >
3131
3232 < hr />
You can’t perform that action at this time.
0 commit comments