aboutsummaryrefslogtreecommitdiffstats
path: root/libavformat
diff options
context:
space:
mode:
authorAndreas Rheinhardt <andreas.rheinhardt@outlook.com>2024-05-02 23:23:17 +0200
committerAndreas Rheinhardt <andreas.rheinhardt@outlook.com>2024-05-04 16:29:58 +0200
commit601873263e618e2dc2b615ae95e605575171ee30 (patch)
tree38770a70ca3a638c75cfad7d78574dfe21afc571 /libavformat
parentdf868bae239b263f7b71bfd3b5a5f4b0e5179ea1 (diff)
downloadffmpeg-601873263e618e2dc2b615ae95e605575171ee30.tar.gz
avformat/movenc: Check av_malloc()
Fixes Coverity issue #1596735. Reviewed-by: Michael Niedermayer <michael@niedermayer.cc> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
Diffstat (limited to 'libavformat')
-rw-r--r--libavformat/movenc.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/libavformat/movenc.c b/libavformat/movenc.c
index e9bbfd67cf..b4c1db2774 100644
--- a/libavformat/movenc.c
+++ b/libavformat/movenc.c
@@ -1221,6 +1221,8 @@ static int mov_write_chnl_tag(AVFormatContext *s, AVIOContext *pb, MOVTrack *tra
if (ret || !config) {
config = 0;
speaker_pos = av_malloc(layout->nb_channels);
+ if (!speaker_pos)
+ return AVERROR(ENOMEM);
ret = ff_mov_get_channel_positions_from_layout(layout,
speaker_pos, layout->nb_channels);
if (ret) {