avformat/movenc: Check av_malloc()

Fixes Coverity issue .

Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
(cherry picked from commit 601873263e618e2dc2b615ae95e605575171ee30)
This commit is contained in:
Andreas Rheinhardt 2024-05-02 23:23:17 +02:00
parent 7050b247b2
commit a08da68e0a

@ -1222,6 +1222,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) {