update libavformat/mxfdec.c.

fix bug

Signed-off-by: ziyugao <gaoziyu0614@outlook.com>
This commit is contained in:
ziyugao 2024-09-23 08:03:44 +00:00 committed by Gitee
parent cc3e6314be
commit 5ace4c7119
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F

View File

@ -1885,6 +1885,10 @@ static int mxf_edit_unit_absolute_offset(MXFContext *mxf, MXFIndexTable *index_t
return mxf_absolute_bodysid_offset(mxf, index_table->body_sid, offset_temp, offset_out, partition_out);
} else {
/* EditUnitByteCount == 0 for VBR indexes, which is fine since they use explicit StreamOffsets */
if (s->edit_unit_byte_count && (s->index_duration > INT64_MAX / s->edit_unit_byte_count ||
s->edit_unit_byte_count * s->index_duration > INT64_MAX - offset_temp)
)
return AVERROR_INVALIDDATA;
offset_temp += s->edit_unit_byte_count * s->index_duration;
}
}