avcodec/sonic: Don't hardcode sizeof(int) == 4

Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
This commit is contained in:
Andreas Rheinhardt 2020-11-01 14:52:49 +01:00
parent cba55c3353
commit 63f5f01226
1 changed files with 2 additions and 2 deletions

View File

@ -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];