Hi,

in the override function for wxImage::SetAlpha() in wxcore_override.hpp there is
the following code:

size_t size = 3*self->GetWidth()*self->GetHeight();
memcpy(self->GetData(), data, wxMin(len, size));  

I think this is wrong because alpha channel data is only one byte per pixel.
Thus, the code above is likely to crash if the user calls SetAlphaData() with
a string containing more than width*height bytes. Instead, it should be:

size_t size = self->GetWidth()*self->GetHeight();
memcpy(self->GetData(), data, wxMin(len, size));  

-- 
Best regards,
 Andreas Falkenhahn                          mailto:andr...@falkenhahn.com


------------------------------------------------------------------------------
Get 100% visibility into Java/.NET code with AppDynamics Lite!
It's a free troubleshooting tool designed for production.
Get down to code-level detail for bottlenecks, with <2% overhead. 
Download for free and get started troubleshooting in minutes. 
http://pubads.g.doubleclick.net/gampad/clk?id=48897031&iu=/4140/ostg.clktrk
_______________________________________________
wxlua-users mailing list
wxlua-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wxlua-users

Reply via email to