[Ffmpeg-devel] Frank patch to h264.c for robustness
    Stefan Gehrer 
    stefan.gehrer
       
    Wed Dec  6 22:19:20 CET 2006
    
    
  
Michael Niedermayer wrote:
>
>> @@ -8117,6 +8139,12 @@
>>  
>>          buf_index+=3;
>>        }
>> +      
>> +        if ( h->is_avc && nalsize > 1000000 ) 
>> +        {	
>> +            // frank prevent problem when seeking in a h264 mov file. 
>> +            return -1;
>> +        }
>>     
>
> whatever this is supposed to do it is wrong, nalsize can very well be
> arbitrary large
I think a maximum NAL size can be derived from the level by
considering the maximum allowed frame size and the minimum
compression ratio (2 for most levels). From my understanding of the
spec this would give a largest possible NAL size of 6.75 MB.
Don't know if checking for such a size really improves error
robustness significantly though.
Regards
Stefan Gehrer
    
    
More information about the ffmpeg-devel
mailing list