[vlc-devel] [PATCH] Let Render() throw an error message and return right away if the SPU region height turns out to be zero.

Rémi Denis-Courmont remi at remlab.net
Sun Jul 5 11:25:09 CEST 2009


Le dimanche 5 juillet 2009 11:38:51 Fabian Keil, vous avez écrit :
> The attached patch fixes a problem on FreeBSD 8.0 where vlc
> triggers an assertion in jemalloc if the SPU region height
> is zero.

I fail to see the link between a zero SPU region height and a crash an 
assertion failure in libc.

> The backtrace looks like this:
> #0  0x0000000801118eac in thr_kill () from /lib/libc.so.7
> #1  0x00000008011afa0b in abort () from /lib/libc.so.7
> #2  0x0000000801196e45 in __assert () from /lib/libc.so.7
> #3  0x000000080113ae81 in malloc_usable_size () from /lib/libc.so.7
> #4  0x000000080113e098 in posix_memalign () from /lib/libc.so.7
> #5  0x00000008007cb842 in __vout_AllocatePicture (p_this=Variable "p_this"
> is not available.) at vout_pictures.h:126

From the stack trace, I guess the allocated size is invalid. *But* I do not 
understand why the problem would be _specific_ to zero height SPU region in 
the SPU decoder. If vout_AllocatePicture() or whatever has an integer 
underflow or some other kind of arithmetic error, I would rather have it fixed 
that worked around.

In principle, while useless, there is no reason why allocating an empty 
picture should not be possible. posix_memalign() does support zero-length 
allocation anyway:
http://www.opengroup.org/onlinepubs/9699919799/functions/posix_memalign.html
| If the size of the space requested is 0, the behavior is
| implementation-defined; the value returned in memptr shall be either a
| null pointer or a unique pointer.

-- 
Rémi Denis-Courmont
http://www.remlab.net/




More information about the vlc-devel mailing list