aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec/sonic.c
diff options
context:
space:
mode:
authorAndreas Rheinhardt <andreas.rheinhardt@gmail.com>2020-11-01 14:52:49 +0100
committerAndreas Rheinhardt <andreas.rheinhardt@gmail.com>2020-11-04 21:30:56 +0100
commit63f5f01226ff0d335ce1c2005fb73eaa05742741 (patch)
tree30f326a1444d2076369541e91b97a41e95655790 /libavcodec/sonic.c
parentcba55c335370ed15d6f846b312bfa3a23e318550 (diff)
downloadffmpeg-63f5f01226ff0d335ce1c2005fb73eaa05742741.tar.gz
avcodec/sonic: Don't hardcode sizeof(int) == 4
Reviewed-by: Michael Niedermayer <michael@niedermayer.cc> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
Diffstat (limited to 'libavcodec/sonic.c')
-rw-r--r--libavcodec/sonic.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/libavcodec/sonic.c b/libavcodec/sonic.c
index bca1eca27a..88d7672bf2 100644
--- a/libavcodec/sonic.c
+++ b/libavcodec/sonic.c
@@ -509,7 +509,7 @@ static int modified_levinson_durbin(int *window, int window_entries,
if (!state)
return AVERROR(ENOMEM);
- memcpy(state, window, 4* window_entries);
+ memcpy(state, window, window_entries * sizeof(*state));
for (i = 0; i < out_entries; i++)
{
@@ -761,7 +761,7 @@ static int sonic_encode_frame(AVCodecContext *avctx, AVPacket *avpkt,
break;
}
- memset(s->window, 0, 4* s->window_size);
+ memset(s->window, 0, s->window_size * sizeof(*s->window));
for (i = 0; i < s->tail_size; i++)
s->window[x++] = s->tail[i];