From c0727b2d9dfae58838a35c5845dfa416e347b024 Mon Sep 17 00:00:00 2001 From: Andreas Rheinhardt Date: Wed, 22 May 2024 10:49:10 +0200 Subject: [PATCH] avformat/matroskaenc: Check ff_put_wav_header() failure Fixes Coverity issue #1506706. Signed-off-by: Andreas Rheinhardt Signed-off-by: Paul B Mahol --- libavformat/matroskaenc.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/libavformat/matroskaenc.c b/libavformat/matroskaenc.c index 126fe054f2..57881637de 100644 --- a/libavformat/matroskaenc.c +++ b/libavformat/matroskaenc.c @@ -1250,7 +1250,9 @@ static int mkv_assemble_codecprivate(AVFormatContext *s, AVIOContext *dyn_cp, par->codec_tag = tag; /* Same comment as for ff_put_bmp_header applies here. */ - ff_put_wav_header(s, dyn_cp, par, FF_PUT_WAV_HEADER_FORCE_WAVEFORMATEX); + ret = ff_put_wav_header(s, dyn_cp, par, FF_PUT_WAV_HEADER_FORCE_WAVEFORMATEX); + if (ret < 0) + return ret; #endif }