evas wbmp loader: coming previous patch with fixing wrong calc.

Those bits must be rounded if they are not fit to 8 bits.

see: 68fe9ec6bf
This commit is contained in:
Hermet Park 2019-04-24 10:18:57 +09:00
parent 54754ab878
commit bffce65f9c
1 changed files with 2 additions and 2 deletions

View File

@ -76,7 +76,7 @@ evas_image_load_file_head_wbmp(void *loader_data,
/* Wbmp header identifier is too weak....
Here checks size validation whether it's acutal wbmp or not. */
if (((w * h) >> 3) + position != length)
if ((((w * h) + 7) >> 3) + position != length)
{
*error = EVAS_LOAD_ERROR_UNKNOWN_FORMAT;
goto bail;
@ -138,7 +138,7 @@ evas_image_load_file_data_wbmp(void *loader_data,
/* Wbmp header identifier is too weak....
Here checks size validation whether it's acutal wbmp or not. */
if (((w * h) >> 3) + position != length)
if ((((w * h) + 7) >> 3) + position != length)
{
*error = EVAS_LOAD_ERROR_UNKNOWN_FORMAT;
goto bail;