[FFmpeg-devel] [PATCH] copy language from input stream to output stream

Aurelien Jacobs aurel
Wed Jul 25 21:42:08 CEST 2007


On Wed, 25 Jul 2007 20:10:54 +0200
Michael Niedermayer <michaelni at gmx.at> wrote:

> Hi
> 
> On Wed, Jul 25, 2007 at 05:47:22PM +0200, Aurelien Jacobs wrote:
> > Hi,
> > 
> > Attached patch allows to copy language information from input stream to output.
> > Ok to apply ?
> > 
> > Aurel
> 
> > Index: ffmpeg.c
> > ===================================================================
> > --- ffmpeg.c	(r??vision 9786)
> > +++ ffmpeg.c	(copie de travail)
> > @@ -1506,6 +1506,9 @@
> >          codec = ost->st->codec;
> >          icodec = ist->st->codec;
> >  
> > +        if (!ost->st->language[0])
> > +            strcpy(ost->st->language, ist->st->language);
> 
> please use strlcpy
> 
> yes i know the input should be null terminated but if its not then strcpy
> would be bad here

Indeed, input must be null terminated, else this indicate a bug
somewhere else.
Well better be safe than sorry, so I applied using av_strlcpy().

BTW: in case someone is interested, there is a bunch of strcpy()
to review and probably change to av_strlcpy() in ffmpeg.c.

Aurel




More information about the ffmpeg-devel mailing list