eet: add to basic eet_image EAPIs checking on NULL
@fix Summary: to avoid segfaults with NULL raw data, add checking on NULL to basic eet_image APIS Reviewers: NikaWhite, cedric, myoungwoon, jpeg Reviewed By: jpeg Subscribers: t.naumenko, jpeg Differential Revision: https://phab.enlightenment.org/D4386 Signed-off-by: Cedric Bail <cedric@osg.samsung.com>
This commit is contained in:
parent
cc9e9c57d4
commit
e6b074ad21
|
@ -1577,6 +1577,9 @@ eet_data_image_encode_cipher(const void *data,
|
|||
unsigned int ciphered_sz = 0;
|
||||
int size = 0;
|
||||
|
||||
if (!data)
|
||||
return NULL;
|
||||
|
||||
switch (lossy)
|
||||
{
|
||||
case EET_IMAGE_LOSSLESS:
|
||||
|
@ -1688,6 +1691,9 @@ eet_data_image_header_advance_decode_cipher(const void *data,
|
|||
unsigned int deciphered_sz = 0;
|
||||
int r = 0;
|
||||
|
||||
if (!data)
|
||||
return NULL;
|
||||
|
||||
if (cipher_key)
|
||||
{
|
||||
if (!eet_decipher(data, size, cipher_key, strlen(cipher_key),
|
||||
|
@ -2083,6 +2089,9 @@ eet_data_image_decode_cipher(const void *data,
|
|||
void *deciphered_d = NULL;
|
||||
unsigned int deciphered_sz = 0;
|
||||
|
||||
if (!data)
|
||||
return NULL;
|
||||
|
||||
if (cipher_key)
|
||||
{
|
||||
if (!eet_decipher(data, size, cipher_key, strlen(cipher_key),
|
||||
|
@ -2171,6 +2180,9 @@ eet_data_image_decode_to_cspace_surface_cipher(const void *data,
|
|||
void *deciphered_d = NULL;
|
||||
unsigned int deciphered_sz = 0;
|
||||
|
||||
if (!data)
|
||||
return NULL;
|
||||
|
||||
if (cipher_key)
|
||||
{
|
||||
if (!eet_decipher(data, size, cipher_key, strlen(cipher_key),
|
||||
|
|
Loading…
Reference in New Issue