[DVDnav-discuss] [PATCH] crash while processing mac the ripper "feature title extract" images

John Stebbins stebbins at jetheaddev.com
Tue Dec 8 17:15:24 CET 2009


On 12/07/2009 05:37 AM, Dominik 'Rathann' Mierzejewski wrote:
> On Wednesday, 18 November 2009 at 00:41, John Stebbins wrote:
>    
>> Mac the ripper's feature title extraction removes menus from the
>> resulting image, but does not remove navigation instructions that
>> attempt to jump to those menus.  This patch checks that a menu exists
>> before acting on such instructions.  If the menu does not exist, the it
>> puts the vm into the stopped state.
>>      
> [...]
>    
>> @@ -1488,6 +1495,10 @@
>>         /* Allowed from anywhere except the VTS Title domain */
>>         /* Stop SPRM9 Timer and any GPRM counters */
>>         assert((vm->state).domain != VTS_DOMAIN); /* ?? */
>> +      if(vm->vmgi == NULL || vm->vmgi->pgci_ut == NULL) {
>> +        link_values.command = Exit;
>> +        break;
>> +      }
>>         (vm->state).domain = VMGM_DOMAIN;
>>         if(!set_MENU(vm, link_values.data1))
>>   	assert(0);
>> @@ -1504,14 +1515,22 @@
>>   	if (link_values.data1 != (vm->state).vtsN) {
>>   	  /* the normal case */
>>   	  assert((vm->state).domain == VMGM_DOMAIN || (vm->state).domain == FP_DOMAIN); /* ?? */
>> -	  (vm->state).domain = VTSM_DOMAIN;
>>   	  if (!ifoOpenNewVTSI(vm, vm->dvd, link_values.data1))  /* Also sets (vm->state).vtsN */
>>   	    assert(0);
>> +          if(vm->vtsi == NULL || vm->vtsi->pgci_ut == NULL) {
>> +            link_values.command = Exit;
>> +            break;
>>      
> Code duplication. Maybe replace all such blocks with a goto fail, like above?
>
> Regards,
> R.
>
>    
I didn't add a goto because I was trying to adhere to the style used in the
rest of that function.  There are several places in that function where
link_values.command is assigned Exit in error conditions and then "break"s.
After having a second look, the other goto I added isn't necessary either.
"return 0" is all that's needed there.

Anyway, I found another condition similar to the missing menu issue.  A jump
to a missing VTS also crashes.  So here's an updated patch that addresses
this as well.


-------------- next part --------------
A non-text attachment was scrubbed...
Name: dvdnav-missing-menu-vts.diff
Type: text/x-patch
Size: 5485 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/dvdnav-discuss/attachments/20091208/a41489ba/attachment.bin>


More information about the DVDnav-discuss mailing list