forked from enlightenment/efl
add null checks to WebPDecodeBGRA() returns in webp loader
SPANK SPANK, IGOR! SVN revision: 76521
This commit is contained in:
parent
d9dae5b06b
commit
86e07547f1
|
@ -98,6 +98,12 @@ evas_image_load_file_data_webp(Evas_Img_Load_Params *ilp, const char *file, cons
|
|||
fclose(f);
|
||||
|
||||
decoded = WebPDecodeBGRA(data, file_size, &width, &height);
|
||||
if (!decoded)
|
||||
{
|
||||
*error = EVAS_LOAD_ERROR_UNKNOWN_FORMAT;
|
||||
free(data);
|
||||
goto close_file;
|
||||
}
|
||||
memcpy(ilp->buffer, decoded, width * height * 4);
|
||||
evas_cserve2_image_premul(ilp);
|
||||
|
||||
|
|
|
@ -116,6 +116,11 @@ evas_image_load_file_data_webp(Image_Entry *ie, const char *file, const char *ke
|
|||
}
|
||||
|
||||
decoded = WebPDecodeBGRA(data, file_size, &width, &height);
|
||||
if (!decoded)
|
||||
{
|
||||
*error = EVAS_LOAD_ERROR_UNKNOWN_FORMAT;
|
||||
goto free_data;
|
||||
}
|
||||
memcpy(surface, decoded, width * height * 4);
|
||||
evas_common_image_premul(ie);
|
||||
|
||||
|
|
Loading…
Reference in New Issue