[libbluray-devel] Mistake in libbluray/disc/disc.c?

Petri Hintukainen phintuka at users.sourceforge.net
Mon Mar 19 14:21:05 CET 2018


su, 2018-03-18 kello 15:57 -0700, glenn kirjoitti:
> Hi,
> 
> I’ve been trying to get Kodi18, libbluray and libmmbd to play
> together nicely and I’ve run across what looks to me like a mistake
> in libbluray 1.0.2 code. Specifically, line 340 of
> libbluray/disc/disc.c:
> 
>  340     struct dec_dev dev = { p->fs_handle, p-
> >pf_file_open_bdrom, p, (file_openFp)disc_open_path, p-
> >disc_root, device_path };
> 
> The third member of that structure is p, which is a pointer to a
> BD_DISC structure.
> 
> However, the declaration of dec_dev (in libbluray/disc/dec.h) seems
> to indicate that the third member is intended to be a (possibly
> opaque) handle to be used when calling the function pointed to by the
> fourth member:
> 
>  /* device to use */
>   37 struct dec_dev {
>   38     void          *file_open_bdrom_handle;
>   39     file_openFp   pf_file_open_bdrom;
>   40     void          *file_open_vfs_handle;
>   41     file_openFp   pf_file_open_vfs;
>   42
>     const char    *root;   /* may be NULL if disc is not mounted */
>   43
>     const char    *device; /* may be null if not reading from real de
> vice */
>   44 };
> 
> Could someone who is familiar with the code determine whether the
> line in question will function as originally intended and provide a
> patch if that is not the case.

Yes, it is correct.
p is used with disc_open_path(), which expects a pointer to BD_DISC.

> I’m in no position to do this myself. I’m just starting to learn C
> and C++ and can’t properly judge the consequences of any fix that
> seems to work for me. A little knowledge is a dangerous thing :-(
> 
> dgktkr
> _______________________________________________
> libbluray-devel mailing list
> libbluray-devel at videolan.org
> https://mailman.videolan.org/listinfo/libbluray-devel


More information about the libbluray-devel mailing list