mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-07-01 01:27:10 -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
|
@ -155,11 +155,19 @@ class p3ChatService::AvatarInfo
|
||||||
}
|
}
|
||||||
|
|
||||||
void init(const unsigned char *jpeg_data,int size)
|
void init(const unsigned char *jpeg_data,int size)
|
||||||
|
{
|
||||||
|
if(size == 0)
|
||||||
|
{
|
||||||
|
_image_size = 0;
|
||||||
|
_image_data = nullptr;
|
||||||
|
}
|
||||||
|
else
|
||||||
{
|
{
|
||||||
_image_size = size ;
|
_image_size = size ;
|
||||||
_image_data = (unsigned char*)rs_malloc(size) ;
|
_image_data = (unsigned char*)rs_malloc(size) ;
|
||||||
memcpy(_image_data,jpeg_data,size) ;
|
memcpy(_image_data,jpeg_data,size) ;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
AvatarInfo(const unsigned char *jpeg_data,int size)
|
AvatarInfo(const unsigned char *jpeg_data,int size)
|
||||||
{
|
{
|
||||||
init(jpeg_data,size) ;
|
init(jpeg_data,size) ;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue