evas wbmp: fix wrong calc order. 52/204452/1
authorHermet Park <hermetpark@gmail.com>
Wed, 24 Apr 2019 05:01:06 +0000 (14:01 +0900)
committerHermet Park <hermetpark@gmail.com>
Wed, 24 Apr 2019 05:05:31 +0000 (14:05 +0900)
Double check patch again, since my wrong logical thinking,
Every width must be considered to rounding up fiting 8 bits.
this new compuation must be correct.

Change-Id: I112b88560b97e7e413f24b6d17ecaff3588d280e

src/modules/evas/image_loaders/wbmp/evas_image_load_wbmp.c

index 181b14f..4a3ae77 100644 (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) + 7) >> 3) + position != length)
+   if ((((w + 7) >> 3) * h) + 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) + 7) >> 3) + position != length)
+   if ((((w + 7) >> 3) * h) + position != length)
      {
         *error = EVAS_LOAD_ERROR_UNKNOWN_FORMAT;
         goto bail;