[FFmpeg-devel] [PATCH 1/3] Support palette information for	vobsub's stored as text in extradata
    Joakim Plate 
    elupus at ecce.se
       
    Sun Sep 11 23:27:43 CEST 2011
    
    
  
>>  }
>>  
>> +static int dvdsub_init(AVCodecContext *avctx)
>> +{
>> +    DVDSubContext *ctx = (DVDSubContext*) avctx->priv_data;
>> +    char *data = avctx->extradata;
>> +
>> +    if (!avctx->extradata || !avctx->extradata_size)
>> +        return 1;
>> +
>> +    data[avctx->extradata_size] = '\0';
> 
> this does not look safe
As far as I known, extradata must be padded, so writing one extra byte
should always be safe. Then again, i'm not sure how well known it is that
is should be. I suppose i could make a copy of it instead if we don't want
to rely on padding being present.
/Joakim
    
    
More information about the ffmpeg-devel
mailing list