[FFmpeg-cvslog] avformat/smoothstreamingenc: check return value of avcodec_parameters_copy()
Marth64
git at videolan.org
Wed Jan 8 07:52:00 EET 2025
ffmpeg | branch: release/7.1 | Marth64 <marth64 at proxyid.net> | Sat Oct 12 12:18:30 2024 -0500| [0a51afd21d6c76a9f4e5797135db6e067e3ad645] | committer: Marth64
avformat/smoothstreamingenc: check return value of avcodec_parameters_copy()
Written in the dominant style of the surrounding code block.
Reviewed-by: ePirat <epirat07 at gmail.com>
Signed-off-by: Marth64 <marth64 at proxyid.net>
(cherry picked from commit 3528bfed450842a991df6e076fe72d4c2eee6432)
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=0a51afd21d6c76a9f4e5797135db6e067e3ad645
---
libavformat/smoothstreamingenc.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/libavformat/smoothstreamingenc.c b/libavformat/smoothstreamingenc.c
index 9547419d31..adf3008003 100644
--- a/libavformat/smoothstreamingenc.c
+++ b/libavformat/smoothstreamingenc.c
@@ -331,7 +331,9 @@ static int ism_write_header(AVFormatContext *s)
if (!(st = avformat_new_stream(ctx, NULL))) {
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->time_base = s->streams[i]->time_base;
More information about the ffmpeg-cvslog
mailing list