[FFmpeg-devel] [PATCH] nellymoserenc: fix crash due to memsetting the wrong area.

Michael Niedermayer michaelni at gmx.at
Fri Apr 6 18:12:46 CEST 2012


On Fri, Apr 06, 2012 at 03:27:04PM +0200, Reimar Döffinger wrote:
> Signed-off-by: Reimar Döffinger <Reimar.Doeffinger at gmx.de>
> ---
>  libavcodec/nellymoserenc.c |    2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/libavcodec/nellymoserenc.c b/libavcodec/nellymoserenc.c
> index 59e0884..d460ffb 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));

LGTM


[...]
-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

There will always be a question for which you do not know the correct awnser.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: Digital signature
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20120406/e4e19391/attachment.asc>


More information about the ffmpeg-devel mailing list