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

Ronald S. Bultje rsbultje
Mon Mar 16 21:15:43 CET 2009


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...

Anyway, you can apply the patch anyway, sorry for breaking stuff.

Ronald




More information about the ffmpeg-cvslog mailing list