[vlc-devel] [PATCH 03/12] bluray: Prevent some crashes when using a special title.
Jean-Baptiste Kempf
jb at videolan.org
Mon Jan 23 01:25:18 CET 2012
On Sun, Jan 22, 2012 at 12:30:58AM +0100, Hugo Beauzée-Luyssen wrote :
> For instance, BLURAY_TITLE_FIRST_PLAY has a value of 0xFFFF.
> Some title may not be parsed because they are too short, so we just ignore
> the event.
> ---
> modules/access/bluray.c | 13 ++++++++++---
> 1 files changed, 10 insertions(+), 3 deletions(-)
>
> diff --git a/modules/access/bluray.c b/modules/access/bluray.c
> index 53d01f3..179c51a 100644
> --- a/modules/access/bluray.c
> +++ b/modules/access/bluray.c
> @@ -367,7 +367,10 @@ static int blurayControl(demux_t *p_demux, int query, va_list args)
> case DEMUX_GET_LENGTH:
> {
> int64_t *pi_length = (int64_t*)va_arg(args, int64_t *);
> - *pi_length = CUR_LENGTH;
> + if ( p_demux->info.i_title < p_sys->i_title )
> + *pi_length = CUR_LENGTH;
> + else
> + *pi_length = 0;
Can you use a ternary here ?
> case BD_EVENT_TITLE:
> - blurayUpdateTitle( p_demux, e->param );
> + if ( e->param < p_sys->i_title )
> + blurayUpdateTitle( p_demux, e->param );
Ok. Although this should have been with 1?
Best regards,
--
Jean-Baptiste Kempf
http://www.jbkempf.com/ - +33 672 704 734
Sent from my Electronic Device
More information about the vlc-devel
mailing list