netpbm/netpbm-10.26.22-pnmtopng-overflow.patch

15 lines
510 B
Diff

--- converter/other/pnmtopng.c
+++ converter/other/pnmtopng.c
@@ -913,9 +913,9 @@
colorhist_vector chv;
unsigned int colors;
- gray *alphas_of_color[MAXPALETTEENTRIES];
+ gray *alphas_of_color[MAXPALETTEENTRIES + 1];
unsigned int alphas_first_index[MAXPALETTEENTRIES];
- unsigned int alphas_of_color_cnt[MAXPALETTEENTRIES];
+ unsigned int alphas_of_color_cnt[MAXPALETTEENTRIES + 1];
getChv(ifP, imagepos, cols, rows, maxval, format, MAXCOLORS,
&chv, &colors);