[FFmpeg-cvslog] r18005 - trunk/libavformat/rmdec.c

Reimar Döffinger Reimar.Doeffinger
Mon Mar 16 21:20:16 CET 2009


On Mon, Mar 16, 2009 at 04:15:43PM -0400, Ronald S. Bultje wrote:
> Hi,
> 
> 2009/3/16 M?ns Rullg?rd <mans at mansr.com>:
> > Vitor Sessak <vitor1001 at gmail.com> writes:
> >> Program received signal SIGSEGV, Segmentation fault.
> >> 0x080c68ff in rm_read_packet (s=0x8916ac0, pkt=0xbf8a1ab0)
> >> ? ? ?at libavformat/rmdec.c:777
> >> 777 ? ? ? ? ? ? ? ? ? st = s->streams[i];
> [..]
> > @@ -774,7 +774,8 @@ static int rm_read_packet(AVFormatContext *s, AVPacket *pkt)
> > ? ? ? ? ? ? ? ? flags = (seq++ == 1) ? 2 : 0;
> > ? ? ? ? ? ? } else {
> > ? ? ? ? ? ? ? ? len=sync(s, &timestamp, &flags, &i, &pos);
> > - ? ? ? ? ? ? ? ?st = s->streams[i];
> > + ? ? ? ? ? ? ? ?if (len > 0)
> > + ? ? ? ? ? ? ? ? ? ?st = s->streams[i];
> > ? ? ? ? ? ? }
> >
> > ? ? ? ? ? ? if(len<0 || url_feof(s->pb))
> 
> Thanks for your help. Why does this crash? st is unused until after I
> check len for validity, before that it's just a memory address, no? I
> mean, I sort of thought this was valid C...

Yes, but i is uninitialized.




More information about the ffmpeg-cvslog mailing list