[FFmpeg-devel] Realmedia patch
Ronald S. Bultje
rsbultje
Fri Sep 26 14:31:47 CEST 2008
Hi Luca & all,
On Wed, Sep 17, 2008 at 5:11 PM, Luca Abeni <lucabe72 at email.it> wrote:
> Ronald S. Bultje wrote:
>> s->duration= (end==AV_NOPTS_VALUE)?AV_NOPTS_VALUE:end-start; // AV_NOPTS_VALUE means live broadcast (and can't seek)
>> + } else if (av_strstart(p, "IsRealDataType:integer;",&p)) {
>> + if (atoi(p) == 1)
>
> I think here you need to check if p is a valid pointer before using atoi()?
> (what happens with a broken SDP ending immediately after "integer;"?)
> I suspect a get_word() (or get_word_sep()) can be needed.
I forgot to address this comment, so here's the test:
$ cat test.c
void main()
{
printf("atoi()=%d\n", atoi(""));
}
$ ./test
atoi()=0
So I think it works as expected. Of course, now that I think about it,
it's kind of stupid to use atoi() in the first place, I could just do
*p == '1'. If anyone cares I can change it, although it's clearly not
in a performance-critical part of the code.
I'll apply soon, but I sort of forgot and didn't really have time
either (family visit :-) ), I'll do it as soon as I find time.
Thanks,
Ronald
More information about the ffmpeg-devel
mailing list