diff --git a/libavformat/hdsenc.c b/libavformat/hdsenc.c index fb0a94892a..20b4b12139 100644 --- a/libavformat/hdsenc.c +++ b/libavformat/hdsenc.c @@ -344,7 +344,7 @@ static int hds_write_header(AVFormatContext *s) goto fail; } - c->streams = av_mallocz(sizeof(*c->streams) * s->nb_streams); + c->streams = av_mallocz_array(s->nb_streams, sizeof(*c->streams)); if (!c->streams) { ret = AVERROR(ENOMEM); goto fail;