[FFmpeg-cvslog] avformat/iamf_writer: clear extradata_size on extradata allocation failure

James Almer git at videolan.org
Tue Mar 5 16:39:41 EET 2024


ffmpeg | branch: master | James Almer <jamrial at gmail.com> | Tue Mar  5 11:23:41 2024 -0300| [988e3a061a917408785d824ecad35967bc9d4bbd] | committer: James Almer

avformat/iamf_writer: clear extradata_size on extradata allocation failure

Signed-off-by: James Almer <jamrial at gmail.com>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=988e3a061a917408785d824ecad35967bc9d4bbd
---

 libavformat/iamf_writer.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

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);



More information about the ffmpeg-cvslog mailing list