Skip to content

Commit f46415f

Browse files
Marth64xT-bagwell
authored andcommitted
avformat/hlsenc: check return value of avcodec_parameters_copy()
Written in the dominant style of the surrounding code block. Signed-off-by: Marth64 <[email protected]> Reviewed-by: Steven Liu <[email protected]>
1 parent 95bb47d commit f46415f

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

libavformat/hlsenc.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -888,7 +888,9 @@ static int hls_mux_init(AVFormatContext *s, VariantStream *vs)
888888

889889
if (!(st = avformat_new_stream(loc, NULL)))
890890
return AVERROR(ENOMEM);
891-
avcodec_parameters_copy(st->codecpar, vs->streams[i]->codecpar);
891+
ret = avcodec_parameters_copy(st->codecpar, vs->streams[i]->codecpar);
892+
if (ret < 0)
893+
return ret;
892894
if (!oc->oformat->codec_tag ||
893895
av_codec_get_id (oc->oformat->codec_tag, vs->streams[i]->codecpar->codec_tag) == st->codecpar->codec_id ||
894896
av_codec_get_tag(oc->oformat->codec_tag, vs->streams[i]->codecpar->codec_id) <= 0) {

0 commit comments

Comments
 (0)