1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2024-12-23 12:43:46 +02:00

avformat/hlsenc: fix memleak in update_variant_stream_info

Signed-off-by: Steven Liu <lq@chinaffmpeg.org>
This commit is contained in:
Steven Liu 2019-08-20 10:29:04 +08:00
parent 661a9b274b
commit d1fe1344ea

View File

@ -2131,14 +2131,18 @@ static int update_variant_stream_info(AVFormatContext *s) {
hls->var_streams[0].nb_streams = s->nb_streams;
hls->var_streams[0].streams = av_mallocz(sizeof(AVStream *) *
hls->var_streams[0].nb_streams);
if (!hls->var_streams[0].streams)
if (!hls->var_streams[0].streams) {
av_free(hls->var_streams);
return AVERROR(ENOMEM);
}
//by default, the first available ccgroup is mapped to the variant stream
if (hls->nb_ccstreams) {
hls->var_streams[0].ccgroup = av_strdup(hls->cc_streams[0].ccgroup);
if (!hls->var_streams[0].ccgroup)
if (!hls->var_streams[0].ccgroup) {
av_free(hls->var_streams);
return AVERROR(ENOMEM);
}
}
for (i = 0; i < s->nb_streams; i++)