diff --git a/libavformat/mpegtsenc.c b/libavformat/mpegtsenc.c index d24baa4ebc792feab9e89ab6aec1c9312cafb064..8d80e072a06be7ab593c76e8dbdae878fb46492e 100644 --- a/libavformat/mpegtsenc.c +++ b/libavformat/mpegtsenc.c @@ -628,7 +628,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 * sizeof(*pids)); + pids = av_malloc_array(s->nb_streams, sizeof(*pids)); if (!pids) return AVERROR(ENOMEM);