avformat/smoothstreamingenc: check return value of avcodec_parameters_copy()

Written in the dominant style of the surrounding code block.

Reviewed-by: ePirat <epirat07@gmail.com>
Signed-off-by: Marth64 <marth64@proxyid.net>
(cherry picked from commit 3528bfed45)
release/7.1
Marth64 3 months ago
parent 3a375e3dcf
commit 0a51afd21d
  1. 4
      libavformat/smoothstreamingenc.c

@ -331,7 +331,9 @@ static int ism_write_header(AVFormatContext *s)
if (!(st = avformat_new_stream(ctx, NULL))) { if (!(st = avformat_new_stream(ctx, NULL))) {
return AVERROR(ENOMEM); return AVERROR(ENOMEM);
} }
avcodec_parameters_copy(st->codecpar, s->streams[i]->codecpar); if ((ret = avcodec_parameters_copy(st->codecpar, s->streams[i]->codecpar)) < 0) {
return ret;
}
st->sample_aspect_ratio = s->streams[i]->sample_aspect_ratio; st->sample_aspect_ratio = s->streams[i]->sample_aspect_ratio;
st->time_base = s->streams[i]->time_base; st->time_base = s->streams[i]->time_base;

Loading…
Cancel
Save