[MPlayer-users] Crash seeking to chapters in a multi-VTS DVD if title is gt 1

Reimar Döffinger Reimar.Doeffinger at stud.uni-karlsruhe.de
Wed Dec 31 15:06:19 CET 2008


On Wed, Dec 31, 2008 at 12:33:22PM +0100, Nico Sabbi wrote:
> are you sure the bug is present in current svn? I can't reproduce the
> bug: set_property chapter never crashes for me, nether with
> CHAPTER >= max
> nor with CHAPTER < 1

crashes no, but hangs, which IMO are caused by libdvdreads horrible API.
The problem is when the selected chapter is at or after the end of the
DVD.
In stream_dvd.c there is this code:
>  len = DVDReadBlocks(d->title, d->cur_pack, 1, data);
>  if(!len) return -1; //error

AFAICT the dvdread API is supposed to return 0 on error (I have no clue
what then the point is of allowing negative values, since I can't see
how they would make any sense, I only see this API behaviour bloating up
the libdvdread code for no good reason).
Problem is, dvdcss read function may also return negative values on read
errors, and the return values of dvdcss are passed through.
So we will end up with len < 0 here and thus an endless loop.
Changing !len to len <= 0 fixes it, and while I am in favour of such a
fix it breaks the dvdread API.

Greetings,
Reimar Döffinger



More information about the MPlayer-users mailing list