[Fix] fix svace issue.
authorSuYeon <suyeon5.kim@samsung.com>
Wed, 21 Jun 2023 06:51:14 +0000 (15:51 +0900)
committerMyungJoo Ham <myungjoo.ham@samsung.com>
Wed, 21 Jun 2023 08:54:49 +0000 (17:54 +0900)
Fix overflow before widen (distance value in 'g_array_set_size' func).

Signed-off-by: SuYeon <suyeon5.kim@samsung.com>
ext/nnstreamer/tensor_decoder/tensordec-boundingbox.c

index 0bafa3f..8e781ec 100644 (file)
@@ -1297,8 +1297,8 @@ update_centroids (void **pdata, GArray * boxes)
         int bcy = box->y + box->height / 2;
 
         d->distance =
-            (guint64) ((c->cx - bcx) * (c->cx - bcx))
-                     +  (guint64) ((c->cy - bcy) * (c->cy - bcy));
+            (guint64) (c->cx - bcx) * (c->cx - bcx)
+                     +  (guint64) (c->cy - bcy) * (c->cy - bcy);
       }
     }
   }