Browse Source

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

Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
tags/n4.4
Andreas Rheinhardt 5 years ago
parent
commit
63f5f01226
1 changed files with 2 additions and 2 deletions
  1. +2
    -2
      libavcodec/sonic.c

+ 2
- 2
libavcodec/sonic.c 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];


Loading…
Cancel
Save