[vlc-devel] [PATCH] dvdnav cannot be trusted to open regular files (fix #4741)

Juha Jeronen juha.jeronen at jyu.fi
Sat May 7 19:23:54 CEST 2011


On 05/07/2011 07:47 PM, Rémi Denis-Courmont wrote:
> Le samedi 7 mai 2011 19:39:40 Juha Jeronen, vous avez écrit :
>> This breaks support for DVD disc images (which I suppose is the whole
>> point of having dvdnav check regular files).
> Of course. There are plenty of valid non-DVD files that have \x00\x02 at that 
> offset. Checking a two bytes magic might work at offset 0, but not any 
> further.

Mm, yes. I agree. This explains completely why it failed for your input,
but not mine. I just got lucky :)

I think we need a more sophisticated check. First idea: maybe we should
first check the magic of supported disc image formats at offset 0, and
only if that matches, then check the anchor?

But this assumes that 1) disc images have a magic at offset 0, and 2)
that magic does not conflict with any supported video/audio file type. I
have no idea if these assumptions are realistic or not.

Alternative idea: require the user to open DVD image files as
dvd:///path/to/file instead of file:///path/to/file. However, in this
second option keeping things convenient for the user gets complicated,
as it would no longer work from the regular open dialog. It would
probably need two ways to invoke the open dialog - one for file:// and
one for dvd://. (The problem with using the existing URI entry field for
this is that it's not browseable. I think local resources should be.)

(I think the feature of playing DVD images is semi-important for "plays
almost anything". Not absolutely critical, but nice to have...)

What's your opinion? (And how about the rest of the team?)


More information about the vlc-devel mailing list