[MPlayer-dev-eng] [PATCH] bugfix for vobsub positioning crash

Csillag Kristof fenwick at freemail.hu
Sat Jan 8 06:03:16 CET 2005


Hi there!

This trivial patch fixes a small error, which can segfault mplayer.

  * * *

There was a small bug in spudec.c, responsible for VobSub subtitles:
when calculating the position of the subtitle box on the screen,
some unsigned integer variables are tested if they are not smaller than
zero. Surprise, they never are. (In fact, when compiling the code, gcc
also mentions this.) Because of this, MPlayer sometimes tries to draw
the subtitles at negative coordinates.

So, with a nice choice of command line parameters, or by moving the
vobsub subtitle up on the screen when playing, we can get a segfault.
Try this:

1. wget http://rht.bme.hu/~lunkwill/computer/mplayer/sample.mkv (3 MB)
2. mplayer -vo x11 -nofs -zoom -spualign 2 -subpos 0 -slang hun \ 
	sample.mkv

..and you can get segfault and/or undefined behavior.

The attached patch fixes this.


-- 
Csillag Kristof <fenwick at freemail.hu>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: csk-vobsub-positioning-segfault-bugfix.patch
Type: text/x-patch
Size: 2458 bytes
Desc: 
URL: <http://lists.mplayerhq.hu/pipermail/mplayer-dev-eng/attachments/20050108/c2ed9341/attachment.bin>


More information about the MPlayer-dev-eng mailing list