[FFmpeg-cvslog] lavf/vobsub: do not count trailing NUL char in extradata.

Clément Bœsch git at videolan.org
Wed Jan 2 09:34:39 CET 2013


ffmpeg | branch: master | Clément Bœsch <ubitux at gmail.com> | Wed Jan  2 09:31:07 2013 +0100| [5a2f3f0bca5ae72b4faa4d64b967de71046d46d5] | committer: Clément Bœsch

lavf/vobsub: do not count trailing NUL char in extradata.

See 36e61e24.

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=5a2f3f0bca5ae72b4faa4d64b967de71046d46d5
---

 libavformat/mpeg.c |    5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/libavformat/mpeg.c b/libavformat/mpeg.c
index afa8618..cc2fe7f 100644
--- a/libavformat/mpeg.c
+++ b/libavformat/mpeg.c
@@ -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;
@@ -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);
 



More information about the ffmpeg-cvslog mailing list