[FFmpeg-cvslog] r14221 - trunk/libavcodec/utils.c

Michael Niedermayer michaelni
Wed Jul 16 15:07:08 CEST 2008


On Wed, Jul 16, 2008 at 09:33:33AM +0200, Stefano Sabatini wrote:
> On date Tuesday 2008-07-15 22:07:05 -0700, Baptiste Coudurier wrote:
> > Baptiste Coudurier wrote:
> > > Hi,
> > > 
> > > stefano wrote:
> > >> Author: stefano
> > >> Date: Sun Jul 13 23:44:00 2008
> > >> New Revision: 14221
> > >>
> > >> Log:
> > >> strdup() the default value for rc_eq in AVCodec when setting it in
> > >> avcodec_get_context_defaults(). The value has to be alloced dinamically
> > >> rather than statically since it may be freed for example by
> > >> av_set_string2(). Fix a segmentation fault.
> > >>
> > >>
> > >> Modified:
> > >>    trunk/libavcodec/utils.c
> > >>
> > >> Modified: trunk/libavcodec/utils.c
> > >> ==============================================================================
> > >> --- trunk/libavcodec/utils.c	(original)
> > >> +++ trunk/libavcodec/utils.c	Sun Jul 13 23:44:00 2008
> > >> @@ -741,7 +741,7 @@ void avcodec_get_context_defaults2(AVCod
> > >>          flags= AV_OPT_FLAG_SUBTITLE_PARAM;
> > >>      av_opt_set_defaults2(s, flags, flags);
> > >>  
> > >> -    s->rc_eq= "tex^qComp";
> > >> +    s->rc_eq= av_strdup("tex^qComp");
> > >>      s->time_base= (AVRational){0,1};
> > >>      s->get_buffer= avcodec_default_get_buffer;
> > >>      s->release_buffer= avcodec_default_release_buffer;
> > > 
> > > I think avcodec_close must now free it.
> 
> Like in the attached patch (BTW I'm not sure if I have to check for
> avctx->rc_eq != NULL)?

patch probably ok

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

I am the wisest man alive, for I know one thing, and that is that I know
nothing. -- Socrates
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-cvslog/attachments/20080716/2682a06a/attachment.pgp>



More information about the ffmpeg-cvslog mailing list