comparison utils.c @ 1141:ef9bf68071d3 libavformat

extradata may be used as bitstream reader input so allocate with padding
author mru
date Thu, 29 Jun 2006 19:42:34 +0000
parents ff241582890f
children e3a585883bbd
comparison
equal deleted inserted replaced
1140:2cfb5e02b299 1141:ef9bf68071d3
1993 } 1993 }
1994 if(st->parser && st->parser->parser->split && !st->codec->extradata){ 1994 if(st->parser && st->parser->parser->split && !st->codec->extradata){
1995 int i= st->parser->parser->split(st->codec, pkt->data, pkt->size); 1995 int i= st->parser->parser->split(st->codec, pkt->data, pkt->size);
1996 if(i){ 1996 if(i){
1997 st->codec->extradata_size= i; 1997 st->codec->extradata_size= i;
1998 st->codec->extradata= av_malloc(st->codec->extradata_size); 1998 st->codec->extradata= av_malloc(st->codec->extradata_size + FF_INPUT_BUFFER_PADDING_SIZE);
1999 memcpy(st->codec->extradata, pkt->data, st->codec->extradata_size); 1999 memcpy(st->codec->extradata, pkt->data, st->codec->extradata_size);
2000 memset(st->codec->extradata + i, 0, FF_INPUT_BUFFER_PADDING_SIZE);
2000 } 2001 }
2001 } 2002 }
2002 2003
2003 /* if still no information, we try to open the codec and to 2004 /* if still no information, we try to open the codec and to
2004 decompress the frame. We try to avoid that in most cases as 2005 decompress the frame. We try to avoid that in most cases as