On Tue, May 17, 2011 at 05:33:29PM +0200, Clément Bœsch wrote:
> On Tue, May 17, 2011 at 10:10:15AM -0400, Mike Williams wrote:
> > Added fixes and tweaks suggested by Maksym Veremeyenko [[email protected]]
> > 
> > Signed-off-by: Mike Williams <[email protected]>
> > ---
> >  ffmpeg.c   |    5 ++---
> >  ffserver.c |   18 +++++++-----------
> >  2 files changed, 9 insertions(+), 14 deletions(-)
> > 
> > diff --git a/ffmpeg.c b/ffmpeg.c
> > index c99c4de..8905fe8 100644
> > --- a/ffmpeg.c
> > +++ b/ffmpeg.c
> > @@ -626,13 +626,12 @@ static int read_ffserver_streams(AVFormatContext *s, 
> > const char *filename)
> >      if (err < 0)
> >          return err;
> >      /* copy stream format */
> > -    s->nb_streams = 0;
> > +    s->nb_streams = ic->nb_streams;
> > +    s->streams = av_mallocz(sizeof(AVStream *) * s->nb_streams);
> >      for(i=0;i<ic->nb_streams;i++) {
> >          AVStream *st;
> >          AVCodec *codec;
> >  
> > -        s->nb_streams++;
> > -
> >          // FIXME: a more elegant solution is needed
> >          st = av_mallocz(sizeof(AVStream));
> >          memcpy(st, ic->streams[i], sizeof(AVStream));
> 
> How is this chunk related to the ffserver crash? Also, you preallocate all
> the streams but you still keep a per-stream allocation, there is something
> wrong imho.
> 

Please ignore this non-sense. Still, this seems not enough to fix the crash.

-- 
Clément B.
_______________________________________________
libav-devel mailing list
[email protected]
https://lists.libav.org/mailman/listinfo/libav-devel

Reply via email to