diff options
author | James Almer <jamrial@gmail.com> | 2024-03-05 11:23:41 -0300 |
---|---|---|
committer | James Almer <jamrial@gmail.com> | 2024-03-05 11:23:41 -0300 |
commit | 988e3a061a917408785d824ecad35967bc9d4bbd (patch) | |
tree | 585e1ff7fc3ebedfcae6b0d1f2669a3d5cd6ad27 | |
parent | 440f8186ef9baf3f581fc463f318014d3176c4cd (diff) | |
download | ffmpeg-988e3a061a917408785d824ecad35967bc9d4bbd.tar.gz |
avformat/iamf_writer: clear extradata_size on extradata allocation failure
Signed-off-by: James Almer <jamrial@gmail.com>
-rw-r--r-- | libavformat/iamf_writer.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/libavformat/iamf_writer.c b/libavformat/iamf_writer.c index 402cb7f230..8a903a0397 100644 --- a/libavformat/iamf_writer.c +++ b/libavformat/iamf_writer.c @@ -1060,8 +1060,10 @@ int ff_iamf_write_audio_frame(const IAMFContext *iamf, AVIOContext *pb, av_free(codec_config->extradata); codec_config->extradata = av_memdup(new_extradata, new_extradata_size); - if (!codec_config->extradata) + if (!codec_config->extradata) { + codec_config->extradata_size = 0; return AVERROR(ENOMEM); + } codec_config->extradata_size = new_extradata_size; return update_extradata(codec_config); |