mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-03-19 13:36:03 -04:00
fixed missing check in AvatarInfo against empty image data
This commit is contained in:
parent
06be689bef
commit
0efc6b00a1
@ -156,9 +156,17 @@ class p3ChatService::AvatarInfo
|
||||
|
||||
void init(const unsigned char *jpeg_data,int size)
|
||||
{
|
||||
_image_size = size ;
|
||||
_image_data = (unsigned char*)rs_malloc(size) ;
|
||||
memcpy(_image_data,jpeg_data,size) ;
|
||||
if(size == 0)
|
||||
{
|
||||
_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)
|
||||
{
|
||||
|
Loading…
x
Reference in New Issue
Block a user