mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2026-02-04 14:30:55 +08:00
avformat/hlsenc: check return value of avcodec_parameters_copy()
Written in the dominant style of the surrounding code block.
Signed-off-by: Marth64 <marth64@proxyid.net>
Reviewed-by: Steven Liu <lq@chinaffmpeg.org>
(cherry picked from commit f46415f373)
This commit is contained in:
@@ -887,7 +887,9 @@ static int hls_mux_init(AVFormatContext *s, VariantStream *vs)
|
||||
|
||||
if (!(st = avformat_new_stream(loc, NULL)))
|
||||
return AVERROR(ENOMEM);
|
||||
avcodec_parameters_copy(st->codecpar, vs->streams[i]->codecpar);
|
||||
ret = avcodec_parameters_copy(st->codecpar, vs->streams[i]->codecpar);
|
||||
if (ret < 0)
|
||||
return ret;
|
||||
if (!oc->oformat->codec_tag ||
|
||||
av_codec_get_id (oc->oformat->codec_tag, vs->streams[i]->codecpar->codec_tag) == st->codecpar->codec_id ||
|
||||
av_codec_get_tag(oc->oformat->codec_tag, vs->streams[i]->codecpar->codec_id) <= 0) {
|
||||
|
||||
Reference in New Issue
Block a user