Message ID | 20201103175735.170080-3-andreas.rheinhardt@gmail.com |
---|---|
State | Accepted |
Headers | show |
Series | [FFmpeg-devel,1/7] avcodec/sonic: Allocate several buffers together | expand |
Context | Check | Description |
---|---|---|
andriy/x86_make | success | Make finished |
andriy/x86_make_fate | success | Make fate finished |
On Tue, Nov 03, 2020 at 06:57:31PM +0100, Andreas Rheinhardt wrote: > Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com> > --- > libavcodec/sonic.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) LGTM thx [...]
diff --git a/libavcodec/sonic.c b/libavcodec/sonic.c index db2c4339a3..a285228bbc 100644 --- a/libavcodec/sonic.c +++ b/libavcodec/sonic.c @@ -506,7 +506,7 @@ static void modified_levinson_durbin(int *window, int window_entries, int i; int *state = window + window_entries; - memcpy(state, window, 4* window_entries); + memcpy(state, window, window_entries * sizeof(*state)); for (i = 0; i < out_entries; i++) { @@ -755,7 +755,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];
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com> --- libavcodec/sonic.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)