[vlc-devel] [PATCH 03/12] bluray: Prevent some crashes when using a special title.

Hugo Beauzée-Luyssen beauze.h at gmail.com
Mon Jan 23 11:28:56 CET 2012


On Mon, Jan 23, 2012 at 1:25 AM, Jean-Baptiste Kempf <jb at videolan.org> wrote:
> 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,
>

It can and will be merged with 1. I just wanted to make it clear why
some title index are rejected.

-- 
Hugo Beauzée-Luyssen



More information about the vlc-devel mailing list