[MPlayer-dev-eng] [PATCH] Dohm found some Bug: Playlist wrong
Fabian Franz
FabianFranz at gmx.de
Mon Feb 3 01:16:01 CET 2003
Am Montag, 3. Februar 2003 01:13 schrieb Arpi:
> Hi,
>
> > > i don't like these changes, the error msg should be something
> > > meaningful... users usually aren't interested in how many bytes can't
> > > bea allocated, but are interested in the reason, ie which part caused
> > > memory problems.
> >
> > ok, I did it that way, because it was like that in the file whereever I
> > looked ...
>
> ah. i didn't know that... but it's wrong, even if it's such everywhere :)
>
> > > and the last one:
> > > iter->stack_size--;
> > > - iter->loop = iter->status_stack[iter->stack_size];
> > > if(iter->stack_size > 0)
> > > + {
> > > + iter->loop = iter->status_stack[iter->stack_size];
> > > iter->status_stack =
> > > (int*)realloc(iter->status_stack,iter->stack_size*sizeof(int)); + }
> > >
> > > i have no idea, but i would be happy if you could prove this is
> > > required and is a bug or something. or if Albeu would say: "ok,
> > > commit!". (ok don't run firing your fake-mail sender app yet :))
> >
> > ok, it is a 10l, but my fix is not right either as I think about it ...
> >
> > iter->stack_sitze=0; (can happen)
> >
> > iter->stack_size--;
> >
> > now iter->stack_size=-1;
> >
> > iter->loop = iter->status_stack[iter->stack_size];
> >
> > Now it'll segfault!
>
> it's clear. but if the code is well written, 'iter->stack_sitze=0; (can
> happen)' won't happen at all.
>
> and anywa, if iter->stack_sitze=1; then iter->stack_size--; then
> iter->stack_sitze=0; so iter->loop = iter->status_stack[iter->stack_size];
> is valid but your "fix" moves it to if(iter->stack_size>0) instead of
> if(iter->stack_size>=0) ...
>
> > I found it while experimenting, so it can be that it was another bug that
> > caused it, but code is not rock solid, is it ? ;-)
>
> dunno. at least the comandline part works well since a while, so i want to
> avoid breaking it now by commiting patch we don't really understand.
>
> > So there should be one additional if to check if (iter->stack_size >= 0
> > && iter->status_stack)
> > To avoid unnecessary segfaults ...
>
> yes, do it then
no, there is assert to assure it won't happen, so code is broken elsewhere if
it makes such behaviour possible ...
But as I spent one whole day with segfaults, it possibly won't happen in
current code ...
>
> > But there will be one gtk still be in mplayer-code is it ok, or should it
> > be
>
> why?
ok, it can be moved elsewhere, you were right ;-)
Last message in that thread, as I'll send new patches now ...
cu
Fabian
>
>
> A'rpi / Astral & ESP-team
More information about the MPlayer-dev-eng
mailing list