blob: 640c00eb7a26fe748b237f40bbdbaee6f7a4e1a1 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
|
This file is part of mingw-cross-env.
See doc/index.html for further information.
http://trac.wxwidgets.org/changeset/67009
Index: /wxWidgets/branches/WX_2_8_BRANCH/src/common/imagpng.cpp
===================================================================
--- a/src/common/imagpng.cpp (revision 60875)
+++ b/src/common/imagpng.cpp (revision 67009)
@@ -530,5 +530,5 @@
(
PNG_LIBPNG_VER_STRING,
- (voidp) NULL,
+ NULL,
wx_png_error,
wx_png_warning
@@ -587,14 +587,17 @@
if (color_type == PNG_COLOR_TYPE_PALETTE)
{
- const size_t ncolors = info_ptr->num_palette;
+ int ncolors = 0;
+ png_colorp palette;
+ png_get_PLTE( png_ptr, info_ptr, &palette, &ncolors);
unsigned char* r = new unsigned char[ncolors];
unsigned char* g = new unsigned char[ncolors];
unsigned char* b = new unsigned char[ncolors];
-
- for (size_t j = 0; j < ncolors; j++)
+ int j;
+
+ for (j = 0; j < ncolors; j++)
{
- r[j] = info_ptr->palette[j].red;
- g[j] = info_ptr->palette[j].green;
- b[j] = info_ptr->palette[j].blue;
+ r[j] = palette[j].red;
+ g[j] = palette[j].green;
+ b[j] = palette[j].blue;
}
|