avformat/iamf_writer: clear extradata_size on extradata allocation failure

Signed-off-by: James Almer <jamrial@gmail.com>
release/7.0
James Almer 11 months ago
parent 440f8186ef
commit 988e3a061a
  1. 4
      libavformat/iamf_writer.c

@ -1060,8 +1060,10 @@ int ff_iamf_write_audio_frame(const IAMFContext *iamf, AVIOContext *pb,
av_free(codec_config->extradata); av_free(codec_config->extradata);
codec_config->extradata = av_memdup(new_extradata, new_extradata_size); 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); return AVERROR(ENOMEM);
}
codec_config->extradata_size = new_extradata_size; codec_config->extradata_size = new_extradata_size;
return update_extradata(codec_config); return update_extradata(codec_config);

Loading…
Cancel
Save