rapp-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Rapp-dev] [PATCH] Correct validation on double operand functions in rap


From: Mikael Pendse
Subject: [Rapp-dev] [PATCH] Correct validation on double operand functions in rapp_pixop
Date: Wed, 2 Sep 2020 08:25:51 +0000

>From f92578e3d409edf334bc7bcb8927bb84c8b731a9 Mon Sep 17 00:00:00 2001
From: Mikael Pendse <mikpen@axis.com>
Date: Wed, 2 Sep 2020 10:15:14 +0200
Subject: [PATCH] Correct validation on double operand functions in rapp_pixop

Before the dst buffer was checked twice and the src buffer never.
Validating both once seemed more fair.
---
 driver/rapp_pixop.c | 20 ++++++++++----------
 1 file changed, 10 insertions(+), 10 deletions(-)

diff --git a/driver/rapp_pixop.c b/driver/rapp_pixop.c
index 1b18dcd..9dca0df 100644
--- a/driver/rapp_pixop.c
+++ b/driver/rapp_pixop.c
@@ -303,7 +303,7 @@ RAPP_API(int, rapp_pixop_copy_u8,
     }
 
     if (!RAPP_VALIDATE_U8(dst, dst_dim, width, height) ||
-        !RAPP_VALIDATE_U8(dst, dst_dim, width, height))
+        !RAPP_VALIDATE_U8(src, src_dim, width, height))
     {
         /* Return the error code */
         return rapp_error_u8_u8(dst, dst_dim, width, height,
@@ -337,7 +337,7 @@ RAPP_API(int, rapp_pixop_add_u8,
     }
 
     if (!RAPP_VALIDATE_U8(dst, dst_dim, width, height) ||
-        !RAPP_VALIDATE_U8(dst, dst_dim, width, height))
+        !RAPP_VALIDATE_U8(src, src_dim, width, height))
     {
         /* Return the error code */
         return rapp_error_u8_u8(dst, dst_dim, width, height,
@@ -371,7 +371,7 @@ RAPP_API(int, rapp_pixop_avg_u8,
     }
 
     if (!RAPP_VALIDATE_U8(dst, dst_dim, width, height) ||
-        !RAPP_VALIDATE_U8(dst, dst_dim, width, height))
+        !RAPP_VALIDATE_U8(src, src_dim, width, height))
     {
         /* Return the error code */
         return rapp_error_u8_u8(dst, dst_dim, width, height,
@@ -405,7 +405,7 @@ RAPP_API(int, rapp_pixop_sub_u8,
     }
 
     if (!RAPP_VALIDATE_U8(dst, dst_dim, width, height) ||
-        !RAPP_VALIDATE_U8(dst, dst_dim, width, height))
+        !RAPP_VALIDATE_U8(src, src_dim, width, height))
     {
         /* Return the error code */
         return rapp_error_u8_u8(dst, dst_dim, width, height,
@@ -439,7 +439,7 @@ RAPP_API(int, rapp_pixop_subh_u8,
     }
 
     if (!RAPP_VALIDATE_U8(dst, dst_dim, width, height) ||
-        !RAPP_VALIDATE_U8(dst, dst_dim, width, height))
+        !RAPP_VALIDATE_U8(src, src_dim, width, height))
     {
         /* Return the error code */
         return rapp_error_u8_u8(dst, dst_dim, width, height,
@@ -473,7 +473,7 @@ RAPP_API(int, rapp_pixop_suba_u8,
     }
 
     if (!RAPP_VALIDATE_U8(dst, dst_dim, width, height) ||
-        !RAPP_VALIDATE_U8(dst, dst_dim, width, height))
+        !RAPP_VALIDATE_U8(src, src_dim, width, height))
     {
         /* Return the error code */
         return rapp_error_u8_u8(dst, dst_dim, width, height,
@@ -507,7 +507,7 @@ RAPP_API(int, rapp_pixop_lerp_u8,
     }
 
     if (!RAPP_VALIDATE_U8(dst, dst_dim, width, height) ||
-        !RAPP_VALIDATE_U8(dst, dst_dim, width, height))
+        !RAPP_VALIDATE_U8(src, src_dim, width, height))
     {
         /* Return the error code */
         return rapp_error_u8_u8(dst, dst_dim, width, height,
@@ -560,7 +560,7 @@ RAPP_API(int, rapp_pixop_lerpn_u8,
     }
 
     if (!RAPP_VALIDATE_U8(dst, dst_dim, width, height) ||
-        !RAPP_VALIDATE_U8(dst, dst_dim, width, height))
+        !RAPP_VALIDATE_U8(src, src_dim, width, height))
     {
         /* Return the error code */
         return rapp_error_u8_u8(dst, dst_dim, width, height,
@@ -612,7 +612,7 @@ RAPP_API(int, rapp_pixop_lerpi_u8,
     }
 
     if (!RAPP_VALIDATE_U8(dst, dst_dim, width, height) ||
-        !RAPP_VALIDATE_U8(dst, dst_dim, width, height))
+        !RAPP_VALIDATE_U8(src, src_dim, width, height))
     {
         /* Return the error code */
         return rapp_error_u8_u8(dst, dst_dim, width, height,
@@ -664,7 +664,7 @@ RAPP_API(int, rapp_pixop_norm_u8,
     }
 
     if (!RAPP_VALIDATE_U8(dst, dst_dim, width, height) ||
-        !RAPP_VALIDATE_U8(dst, dst_dim, width, height))
+        !RAPP_VALIDATE_U8(src, src_dim, width, height))
     {
         /* Return the error code */
         return rapp_error_u8_u8(dst, dst_dim, width, height,
-- 
2.11.0




reply via email to

[Prev in Thread] Current Thread [Next in Thread]