X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=ffserver.c;h=00153b44aee3621583232f4a0ae176c083679f00;hb=5f08b417b4c0493f9aebe891c9991654acd737ed;hp=a6ab458de62ada0e242ac3216ad39da14e3a94ca;hpb=96761e9306a9f96abaaa6bf53fe48c4d6872f48e;p=ffmpeg diff --git a/ffserver.c b/ffserver.c index a6ab458de62..00153b44aee 100644 --- a/ffserver.c +++ b/ffserver.c @@ -56,7 +56,9 @@ #include "libavutil/time.h" #include +#if HAVE_UNISTD_H #include +#endif #include #include #if HAVE_POLL_H @@ -644,7 +646,7 @@ static int http_server(void) struct pollfd *poll_table, *poll_entry; HTTPContext *c, *c_next; - if(!(poll_table = av_mallocz((nb_max_http_connections + 2)*sizeof(*poll_table)))) { + if(!(poll_table = av_mallocz_array(nb_max_http_connections + 2, sizeof(*poll_table)))) { http_log("Impossible to allocate a poll table handling %d connections.\n", nb_max_http_connections); return -1; } @@ -2295,7 +2297,7 @@ static int http_prepare_data(HTTPContext *c) c->fmt_ctx = *ctx; av_freep(&ctx); av_dict_copy(&(c->fmt_ctx.metadata), c->stream->metadata, 0); - c->fmt_ctx.streams = av_mallocz(sizeof(AVStream *) * c->stream->nb_streams); + c->fmt_ctx.streams = av_mallocz_array(c->stream->nb_streams, sizeof(AVStream *)); for(i=0;istream->nb_streams;i++) { AVStream *src; @@ -3423,7 +3425,7 @@ static int rtp_new_av_stream(HTTPContext *c, if (!st) goto fail; ctx->nb_streams = 1; - ctx->streams = av_mallocz(sizeof(AVStream *) * ctx->nb_streams); + ctx->streams = av_mallocz_array(ctx->nb_streams, sizeof(AVStream *)); if (!ctx->streams) goto fail; ctx->streams[0] = st;