mxfdec: Move the current_partition check inside mxf_read_header()
This fixes SIGSEGV on files where this is actually the case, such as zzuf4.mxf
This commit is contained in:
parent
4ae7d45170
commit
184f479096
@ -1500,11 +1500,6 @@ static int mxf_parse_handle_essence(MXFContext *mxf)
|
|||||||
AVIOContext *pb = mxf->fc->pb;
|
AVIOContext *pb = mxf->fc->pb;
|
||||||
int64_t ret;
|
int64_t ret;
|
||||||
|
|
||||||
if (!mxf->current_partition) {
|
|
||||||
av_log(mxf->fc, AV_LOG_ERROR, "found essence prior to PartitionPack\n");
|
|
||||||
return AVERROR_INVALIDDATA;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (mxf->parsing_backward) {
|
if (mxf->parsing_backward) {
|
||||||
return mxf_seek_to_previous_partition(mxf);
|
return mxf_seek_to_previous_partition(mxf);
|
||||||
} else {
|
} else {
|
||||||
@ -1620,6 +1615,12 @@ static int mxf_read_header(AVFormatContext *s, AVFormatParameters *ap)
|
|||||||
IS_KLV_KEY(klv.key, mxf_essence_element_key) ||
|
IS_KLV_KEY(klv.key, mxf_essence_element_key) ||
|
||||||
IS_KLV_KEY(klv.key, mxf_avid_essence_element_key) ||
|
IS_KLV_KEY(klv.key, mxf_avid_essence_element_key) ||
|
||||||
IS_KLV_KEY(klv.key, mxf_system_item_key)) {
|
IS_KLV_KEY(klv.key, mxf_system_item_key)) {
|
||||||
|
|
||||||
|
if (!mxf->current_partition) {
|
||||||
|
av_log(mxf->fc, AV_LOG_ERROR, "found essence prior to first PartitionPack\n");
|
||||||
|
return AVERROR_INVALIDDATA;
|
||||||
|
}
|
||||||
|
|
||||||
if (!mxf->current_partition->essence_offset) {
|
if (!mxf->current_partition->essence_offset) {
|
||||||
/* for OP1a we compute essence_offset
|
/* for OP1a we compute essence_offset
|
||||||
* for OPAtom we point essence_offset after the KL (usually op1a_essence_offset + 20 or 25)
|
* for OPAtom we point essence_offset after the KL (usually op1a_essence_offset + 20 or 25)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user