[FFmpeg-cvslog] avcodec/av1_metadata_bsf: Check for the existence of units

Andreas Rheinhardt git at videolan.org
Fri Apr 2 19:07:59 EEST 2021


ffmpeg | branch: master | Andreas Rheinhardt <andreas.rheinhardt at outlook.com> | Fri Apr  2 17:16:39 2021 +0200| [8081a0b10f5325b60e885d8823593485019b8a18] | committer: Andreas Rheinhardt

avcodec/av1_metadata_bsf: Check for the existence of units

Fixes a crash with ISOBMFF extradata containing no OBUs.

Reviewed-by: James Almer <jamrial at gmail.com>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt at outlook.com>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=8081a0b10f5325b60e885d8823593485019b8a18
---

 libavcodec/av1_metadata_bsf.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavcodec/av1_metadata_bsf.c b/libavcodec/av1_metadata_bsf.c
index 8cafe461d1..328db5c0da 100644
--- a/libavcodec/av1_metadata_bsf.c
+++ b/libavcodec/av1_metadata_bsf.c
@@ -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) {



More information about the ffmpeg-cvslog mailing list