aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJames Almer <jamrial@gmail.com>2024-03-05 11:23:41 -0300
committerJames Almer <jamrial@gmail.com>2024-03-05 11:23:41 -0300
commit988e3a061a917408785d824ecad35967bc9d4bbd (patch)
tree585e1ff7fc3ebedfcae6b0d1f2669a3d5cd6ad27
parent440f8186ef9baf3f581fc463f318014d3176c4cd (diff)
downloadffmpeg-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.c4
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);