diff mbox series

[FFmpeg-devel,1/4] avformat/asfcrypt: Fix wrong array length in function declaration

Message ID DB6PR0101MB2214F8F88331CD712E0DC7308F879@DB6PR0101MB2214.eurprd01.prod.exchangelabs.com
State Accepted
Commit c807ee6975d9dc6f783f2071bf5cb30d663b53ae
Headers show
Series [FFmpeg-devel,1/4] avformat/asfcrypt: Fix wrong array length in function declaration | expand

Checks

Context Check Description
yinshiyou/make_loongarch64 success Make finished
yinshiyou/make_fate_loongarch64 success Make fate finished
andriy/make_x86 success Make finished
andriy/make_fate_x86 success Make fate finished

Commit Message

Andreas Rheinhardt July 11, 2022, 3:04 a.m. UTC
multiswap_step() and multiswap_inv_step() both only require
six keys; in all current callers, these keys are part of
an array of twelve keys, yet in some of these callers the keys
given to these functions point to the second half of these
twelve keys, so that only six keys are available to these functions.
This led to -Wstringop-overread warnings when compiling with GCC 12.1.
Fix these by adapting the declaration of these functions.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
---
 libavformat/asfcrypt.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
diff mbox series

Patch

diff --git a/libavformat/asfcrypt.c b/libavformat/asfcrypt.c
index c77e37503e..ed68fb60ed 100644
--- a/libavformat/asfcrypt.c
+++ b/libavformat/asfcrypt.c
@@ -73,7 +73,7 @@  static void multiswap_invert_keys(uint32_t keys[12])
         keys[i] = inverse(keys[i]);
 }
 
-static uint32_t multiswap_step(const uint32_t keys[12], uint32_t v)
+static uint32_t multiswap_step(const uint32_t keys[6], uint32_t v)
 {
     int i;
     v *= keys[0];
@@ -85,7 +85,7 @@  static uint32_t multiswap_step(const uint32_t keys[12], uint32_t v)
     return v;
 }
 
-static uint32_t multiswap_inv_step(const uint32_t keys[12], uint32_t v)
+static uint32_t multiswap_inv_step(const uint32_t keys[6], uint32_t v)
 {
     int i;
     v -= keys[5];