X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/51dba3f868be76351d7351aba528ceec5111070c..37b8e6798782278fdfe4f3c1291aaff55cdbb8c9:/src/common/imagpcx.cpp diff --git a/src/common/imagpcx.cpp b/src/common/imagpcx.cpp index d28a456f6a..e6f2f05a87 100644 --- a/src/common/imagpcx.cpp +++ b/src/common/imagpcx.cpp @@ -303,7 +303,7 @@ int SavePCX(wxImage *image, wxOutputStream& stream) wxHashTable h(wxKEY_INTEGER); // image histogram unsigned long key; // key in the hashtable unsigned int i; - + // See if we can save as 8 bit. // if (image->CountColours(256) <= 256) @@ -370,7 +370,7 @@ int SavePCX(wxImage *image, wxOutputStream& stream) key = (r << 16) | (g << 8) | b; hnode = (wxHNode *) h.Get(key); - p[i] = hnode->index; + p[i] = (unsigned char)hnode->index; } break; } @@ -388,7 +388,7 @@ int SavePCX(wxImage *image, wxOutputStream& stream) RLEencode(p, bytesperline * nplanes, stream); } - + free(p); // For 8 bit images, build the palette and write it to the stream