mirror of
https://mirror.skon.top/https://github.com/FFmpeg/FFmpeg
synced 2026-04-30 22:00:51 +08:00
avcodec/av1_metadata_bsf: Check for the existence of units
Fixes a crash with ISOBMFF extradata containing no OBUs.
Reviewed-by: James Almer <jamrial@gmail.com>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
(cherry picked from commit 8081a0b10f)
This commit is contained in:
@@ -120,7 +120,7 @@ static int av1_metadata_update_fragment(AVBSFContext *bsf, AVPacket *pkt,
|
||||
}
|
||||
|
||||
// If a Temporal Delimiter is present, it must be the first OBU.
|
||||
if (frag->units[0].type == AV1_OBU_TEMPORAL_DELIMITER) {
|
||||
if (frag->nb_units && frag->units[0].type == AV1_OBU_TEMPORAL_DELIMITER) {
|
||||
if (ctx->td == BSF_ELEMENT_REMOVE)
|
||||
ff_cbs_delete_unit(frag, 0);
|
||||
} else if (pkt && ctx->td == BSF_ELEMENT_INSERT) {
|
||||
|
||||
Reference in New Issue
Block a user