[FFmpeg-cvslog] avutil/camellia: make LR128() more robust

Giorgio Vazzana git at videolan.org
Fri Jan 2 22:34:40 CET 2015


ffmpeg | branch: master | Giorgio Vazzana <mywing81 at gmail.com> | Fri Jan  2 16:49:12 2015 +0100| [8e38b1539e7d23a75b8a50ab6771ee65f4064d34] | committer: Michael Niedermayer

avutil/camellia: make LR128() more robust

Signed-off-by: Giorgio Vazzana <mywing81 at gmail.com>
Signed-off-by: Michael Niedermayer <michaelni at gmx.at>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=8e38b1539e7d23a75b8a50ab6771ee65f4064d34
---

 libavutil/camellia.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/libavutil/camellia.c b/libavutil/camellia.c
index fcbf970..2e719be 100644
--- a/libavutil/camellia.c
+++ b/libavutil/camellia.c
@@ -126,14 +126,14 @@ static const uint8_t SBOX4[256] =
 
 const int av_camellia_size = sizeof(AVCAMELLIA);
 
-static void LR128(uint64_t* d, uint64_t *K, int x)
+static void LR128(uint64_t d[2], const uint64_t K[2], int x)
 {
     int i = 0;
     if (x >=64 && x < 128) {
         i = 1;
         x -= 64;
     }
-    if (!x || x == 128) {
+    if (x <= 0 || x >= 128) {
         d[0] = K[i];
         d[1] = K[!i];
         return;



More information about the ffmpeg-cvslog mailing list