From: Reimar Döffinger Date: Fri, 6 Apr 2012 13:26:35 +0000 (+0200) Subject: nellymoserenc: fix crash due to memsetting the wrong area. X-Git-Tag: v9_beta1~2121 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=439c3d5bcc4a4560eaf5fd43c6e156e3d9bc42f2;p=platform%2Fupstream%2Flibav.git nellymoserenc: fix crash due to memsetting the wrong area. Signed-off-by: Reimar Döffinger Signed-off-by: Martin Storsjö --- diff --git a/libavcodec/nellymoserenc.c b/libavcodec/nellymoserenc.c index 39449ca..2a12853 100644 --- a/libavcodec/nellymoserenc.c +++ b/libavcodec/nellymoserenc.c @@ -389,7 +389,7 @@ static int encode_frame(AVCodecContext *avctx, AVPacket *avpkt, memcpy(s->buf + NELLY_BUF_LEN, frame->data[0], frame->nb_samples * sizeof(*s->buf)); if (frame->nb_samples < NELLY_SAMPLES) { - memset(s->buf + NELLY_BUF_LEN + avctx->frame_size, 0, + memset(s->buf + NELLY_BUF_LEN + frame->nb_samples, 0, (NELLY_SAMPLES - frame->nb_samples) * sizeof(*s->buf)); if (frame->nb_samples >= NELLY_BUF_LEN) s->last_frame = 1;