Skip to content

Commit

Permalink
lavf/vobsub: do not count trailing NUL char in extradata.
Browse files Browse the repository at this point in the history
See 36e61e2.
  • Loading branch information
ubitux committed Jan 2, 2013
1 parent 1e28fa2 commit 5a2f3f0
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions libavformat/mpeg.c
Original file line number Diff line number Diff line change
Expand Up @@ -597,7 +597,7 @@ static int vobsub_probe(AVProbeData *p)

static int vobsub_read_header(AVFormatContext *s)
{
int i, header_size, ret = 0, header_parsed = 0, langidx = 0;
int i, ret = 0, header_parsed = 0, langidx = 0;
MpegDemuxContext *vobsub = s->priv_data;
char *sub_name = NULL;
size_t fname_len;
Expand Down Expand Up @@ -726,11 +726,10 @@ static int vobsub_read_header(AVFormatContext *s)
goto end;
}
av_bprint_finalize(&header, &header_str);
header_size = header.len + 1;
for (i = 0; i < s->nb_streams; i++) {
AVStream *sub_st = s->streams[i];
sub_st->codec->extradata = av_strdup(header_str);
sub_st->codec->extradata_size = header_size;
sub_st->codec->extradata_size = header.len;
}
av_free(header_str);

Expand Down

0 comments on commit 5a2f3f0

Please sign in to comment.