mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-06-29 08:37:36 -04:00
fixed missing check in AvatarInfo against empty image data
This commit is contained in:
parent
06be689bef
commit
0efc6b00a1
1 changed files with 11 additions and 3 deletions
|
@ -156,9 +156,17 @@ class p3ChatService::AvatarInfo
|
||||||
|
|
||||||
void init(const unsigned char *jpeg_data,int size)
|
void init(const unsigned char *jpeg_data,int size)
|
||||||
{
|
{
|
||||||
_image_size = size ;
|
if(size == 0)
|
||||||
_image_data = (unsigned char*)rs_malloc(size) ;
|
{
|
||||||
memcpy(_image_data,jpeg_data,size) ;
|
_image_size = 0;
|
||||||
|
_image_data = nullptr;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
_image_size = size ;
|
||||||
|
_image_data = (unsigned char*)rs_malloc(size) ;
|
||||||
|
memcpy(_image_data,jpeg_data,size) ;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
AvatarInfo(const unsigned char *jpeg_data,int size)
|
AvatarInfo(const unsigned char *jpeg_data,int size)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue