mirror of
https://github.com/RetroShare/RetroShare.git
synced 2024-10-01 02:35:48 -04:00
fixed malloc problem when chat avatar is missing
This commit is contained in:
parent
e726bd1061
commit
23156ab4b1
@ -169,6 +169,12 @@ class p3ChatService::AvatarInfo
|
|||||||
|
|
||||||
void toUnsignedChar(unsigned char *& data,uint32_t& size) const
|
void toUnsignedChar(unsigned char *& data,uint32_t& size) const
|
||||||
{
|
{
|
||||||
|
if(_image_size == 0)
|
||||||
|
{
|
||||||
|
size = 0 ;
|
||||||
|
data = NULL ;
|
||||||
|
return ;
|
||||||
|
}
|
||||||
data = (unsigned char *)rs_malloc(_image_size) ;
|
data = (unsigned char *)rs_malloc(_image_size) ;
|
||||||
size = _image_size ;
|
size = _image_size ;
|
||||||
memcpy(data,_image_data,size*sizeof(unsigned char)) ;
|
memcpy(data,_image_data,size*sizeof(unsigned char)) ;
|
||||||
|
Loading…
Reference in New Issue
Block a user