default:
/* Private uid used by SONY C0023S01.mxf */
if (IS_KLV_KEY(uid, mxf_sony_mpeg4_extradata)) {
- descriptor->extradata = av_malloc(size + FF_INPUT_BUFFER_PADDING_SIZE);
+ if (descriptor->extradata)
+ av_log(NULL, AV_LOG_WARNING, "Duplicate sony_mpeg4_extradata\n");
+ av_free(descriptor->extradata);
+ descriptor->extradata_size = 0;
+ descriptor->extradata = av_malloc(size);
if (!descriptor->extradata)
return AVERROR(ENOMEM);
descriptor->extradata_size = size;
{
MXFTrack *track = mxf->fc->streams[pkt->stream_index]->priv_data;
pkt->pts = track->sample_count;
+ if (codec->channels <= 0 || av_get_bits_per_sample(codec->codec_id) <= 0)
+ return AVERROR(EINVAL);
track->sample_count += pkt->size / (codec->channels * av_get_bits_per_sample(codec->codec_id) / 8);
return 0;
}