]> git.sesse.net Git - ffmpeg/blobdiff - libavcodec/av1_metadata_bsf.c
vp9_metadata: Avoid allocations and copies of packet structures
[ffmpeg] / libavcodec / av1_metadata_bsf.c
index 842b80c2011c85844b8ee0f18692ca4c86bccb88..bb2ca2075bb5d799139526fc106af61b0d9c0df3 100644 (file)
@@ -133,6 +133,12 @@ static int av1_metadata_filter(AVBSFContext *bsf, AVPacket *pkt)
         goto fail;
     }
 
+    if (frag->nb_units == 0) {
+        av_log(bsf, AV_LOG_ERROR, "No OBU in packet.\n");
+        err = AVERROR_INVALIDDATA;
+        goto fail;
+    }
+
     for (i = 0; i < frag->nb_units; i++) {
         if (frag->units[i].type == AV1_OBU_SEQUENCE_HEADER) {
             obu = frag->units[i].content;