summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGiorgio Vazzana <mywing81@gmail.com>2015-01-02 16:49:12 +0100
committerMichael Niedermayer <michaelni@gmx.at>2015-01-02 21:23:50 +0100
commit8e38b1539e7d23a75b8a50ab6771ee65f4064d34 (patch)
treeea7c1525999b555cdc32471675289862e44bbf95
parent88d19d240aeead6ae00fc2dcab0f60362578bce8 (diff)
avutil/camellia: make LR128() more robust
Signed-off-by: Giorgio Vazzana <mywing81@gmail.com> Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
-rw-r--r--libavutil/camellia.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/libavutil/camellia.c b/libavutil/camellia.c
index fcbf9702b7..2e719bee2d 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;