X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/f081c944e891b0cc76ba648982175279bdbce904..c4fa282ce14a102c5e55aaaec74b7d3b0a605baf:/src/generic/dcpsg.cpp diff --git a/src/generic/dcpsg.cpp b/src/generic/dcpsg.cpp index ed99c1cf25..ff50f09120 100644 --- a/src/generic/dcpsg.cpp +++ b/src/generic/dcpsg.cpp @@ -872,14 +872,14 @@ void wxPostScriptDC::DoDrawBitmap( const wxBitmap& bitmap, wxCoord x, wxCoord y, unsigned char* data = image.GetData(); - /* buffer = line = width*rgb(3)*hexa(2)+'\n'(1)+null(1) */ - char* buffer = new char[ w*6+2 ]; + // size of the buffer = width*rgb(3)*hexa(2)+'\n' + wxCharBuffer buffer(w*6 + 1); int firstDigit, secondDigit; //rows for (int j = 0; j < h; j++) { - char* bufferindex = buffer; + char* bufferindex = buffer.data(); //cols for (int i = 0; i < w*3; i++)