mpegtsenc: allocate correct size for PID table
authorMåns Rullgård <mans@mansr.com>
Thu, 1 Jul 2010 23:21:23 +0000 (23:21 +0000)
committerMåns Rullgård <mans@mansr.com>
Thu, 1 Jul 2010 23:21:23 +0000 (23:21 +0000)
Originally committed as revision 23951 to svn://svn.ffmpeg.org/ffmpeg/trunk

libavformat/mpegtsenc.c

index 52ecd1d..08ede68 100644 (file)
@@ -412,7 +412,7 @@ static int mpegts_write_header(AVFormatContext *s)
     ts->sdt.write_packet = section_write_packet;
     ts->sdt.opaque = s;
 
-    pids = av_malloc(s->nb_streams);
+    pids = av_malloc(s->nb_streams * sizeof(*pids));
     if (!pids)
         return AVERROR(ENOMEM);