[vlc-devel] Re: vlc: svn commit r19276 (jpsaman)

Rémi Denis-Courmont rem at videolan.org
Sat Mar 10 19:54:54 CET 2007


Le samedi 10 mars 2007 20:51, Jean-Paul Saman a écrit :
> Rémi Denis-Courmont wrote:
> > Le samedi 10 mars 2007 18:42, Subversion daemon a écrit :
> >> r19276 | jpsaman | 2007-03-10 17:42:21 +0100 (Sat, 10 Mar 2007) |
> >> 1 line Changed paths:
> >>    M /trunk/modules/misc/playlist/m3u.c
> >>
> >> Sanity check
> >
> > This is utterly useless. VLC assumes that table allocations
> > succeeds, and will crash if they don't. And even if it did not, the
> > right place to check for failure, is straight after the allocation,
> > not at a completely differently place in the code.
> >
> > Removing assertions and/or adding useless sanity checks only hides
> > bugs; it does not solve them at all. That's very BAD.
>
> Not checking the return of p_current results in a Segmentation fault
> because the code is then accessing an invalid pointer. What would be
> the right solution here then according to you? Using
> assert(p_current)?

I am just pointing out, that the table should not contain a NULL pointer 
in the first place. The error should be caught before filling the 
table, not when accessing it.

-- 
Rémi Denis-Courmont
http://www.remlab.net/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 197 bytes
Desc: not available
URL: <http://mailman.videolan.org/pipermail/vlc-devel/attachments/20070310/c1eee4fc/attachment.sig>


More information about the vlc-devel mailing list